Knopflerfish OSGi 5.2.1

org.knopflerfish.service.console
Interface Session


public interface Session

Control interface for a command session.

Version:
$Revision: 1.1.1.1 $
Author:
Gatespace AB
See Also:
ConsoleService

Field Summary
static java.lang.String PROPERTY_AUTHORIZATION
          Constant for the session property that is the session's Authorization object.
static java.lang.String PROPERTY_EXIT_ON_LOGOUT
          Constant for the session property that indicates that the session should be closed if the user logs out.
static java.lang.String PROPERTY_TCP
          Constant for the session property that indicates that the session is a TCP session.
 
Method Summary
 void abortCommand()
          Abort current command in session.
 void addSessionListener(SessionListener l)
          Add session event listener.
 void close()
          Close session.
 char getEscapeChar()
          Get escape character.
 java.lang.String getInterruptString()
          Get interrupt string.
 java.lang.String getName()
          Get session name.
 java.util.Dictionary<java.lang.String,java.lang.Object> getProperties()
          Returns the property information tied to this session.
 void removeSessionListener(SessionListener l)
          Remove session event listener.
 void setEscapeChar(char ch)
          Set escape character.
 void setInterruptString(java.lang.String str)
          Set interrupt string.
 

Field Detail

PROPERTY_AUTHORIZATION

static final java.lang.String PROPERTY_AUTHORIZATION
Constant for the session property that is the session's Authorization object.

See Also:
Constant Field Values

PROPERTY_TCP

static final java.lang.String PROPERTY_TCP
Constant for the session property that indicates that the session is a TCP session.

See Also:
Constant Field Values

PROPERTY_EXIT_ON_LOGOUT

static final java.lang.String PROPERTY_EXIT_ON_LOGOUT
Constant for the session property that indicates that the session should be closed if the user logs out. If this is not set, the session will be kept open, but no Authorization object will be present and hence the user will have no special rights.

See Also:
Constant Field Values
Method Detail

abortCommand

void abortCommand()
Abort current command in session. Sends an interrupt to the thread executing the command. The command should terminate as soon as possible when it receives an interrupt.

Throws:
java.lang.IllegalStateException - If this session is closed.

getEscapeChar

char getEscapeChar()
Get escape character.

Returns:
Current escape character
Throws:
java.lang.IllegalStateException - If this session is closed.
See Also:
setEscapeChar(char)

setEscapeChar

void setEscapeChar(char ch)
Set escape character. The escape character is used to escape the interrupt string and the escape character.

Parameters:
ch - new escape character
Throws:
java.lang.IllegalStateException - If this session is closed.

getInterruptString

java.lang.String getInterruptString()
Get interrupt string.

Returns:
Current interrupt string
Throws:
java.lang.IllegalStateException - If this session is closed.
See Also:
setInterruptString(java.lang.String)

setInterruptString

void setInterruptString(java.lang.String str)
Set interrupt string. When the read thread sees this string in the input it will call abortCommand() for this session.

Parameters:
str - new interrupt string
Throws:
java.lang.IllegalStateException - If this session is closed.

getName

java.lang.String getName()
Get session name.

Returns:
Current session name

close

void close()
Close session. Interrupts all threads and waits for them to terminate.


addSessionListener

void addSessionListener(SessionListener l)
Add session event listener. This listener will be called when the session is closed.

Parameters:
l - session listener
Throws:
java.lang.IllegalStateException - If this session is closed.

removeSessionListener

void removeSessionListener(SessionListener l)
Remove session event listener.

Parameters:
l - session listener
Throws:
java.lang.IllegalStateException - If this session is closed.
See Also:
addSessionListener(org.knopflerfish.service.console.SessionListener)

getProperties

java.util.Dictionary<java.lang.String,java.lang.Object> getProperties()
Returns the property information tied to this session.

Returns:
Properties associated with this Session.

Knopflerfish OSGi 5.2.1