de.fhg.igd.semoa.shell
Class RemoteShellServer

java.lang.Object
  extended byde.fhg.igd.semoa.service.AbstractService
      extended byde.fhg.igd.semoa.net.AbstractServer
          extended byde.fhg.igd.semoa.shell.RemoteShellServer
All Implemented Interfaces:
Runnable, Server, Service
Direct Known Subclasses:
SSLRemoteShellServer

public class RemoteShellServer
extends AbstractServer

Provides a simple server that listens on incoming network connections for incoming agents.

Version:
"$Id: RemoteShellServer.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters

Nested Class Summary
protected  class RemoteShellServer.Job
          An inner class that handles the connections.
 
Field Summary
private static String[] DEPEND_
          The dependencies to other objects in the global Environment.
static String PROTOCOL
          The protocol name.
 
Fields inherited from class de.fhg.igd.semoa.net.AbstractServer
bad_, DEFAULT_CAPACITY, good_, MAX_CAPACITY, thread_
 
Fields inherited from class de.fhg.igd.semoa.service.AbstractService
REV_POSTFIX, REV_PREFIX
 
Fields inherited from interface de.fhg.igd.semoa.net.Server
BOUND_TO_PORT, ERROR, RUNNING, SHUTDOWN, UNDEFINED
 
Constructor Summary
RemoteShellServer()
          Creates a new instance.
 
Method Summary
protected  Runnable createJob(Socket connection)
          Creates the job that handles the given connection.
 String[] dependencies()
          Returns the dependencies of this service as described in Service.
 String info()
          Returns the informative string which should describe the service's essence in a sentence.
 String protocol()
           
 String revision()
          Returns the revision number of this class as a string.
 
Methods inherited from class de.fhg.igd.semoa.net.AbstractServer
author, bad, createServerSocket, exceptionInfo, getCapacity, getMaximumSize, getPort, getServerState, good, handleConnection, isEnabled, localURL, rebind, run, serverStateChanged, setCapacity, setEnabled, setMaximumSize, setPort, shutdown, signal, toString
 
Methods inherited from class de.fhg.igd.semoa.service.AbstractService
checkDependencies, docs, doPrivileged, doPrivileged, getACC, getEnvironment, majorVersion, minorVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOCOL

public static final String PROTOCOL
The protocol name.

See Also:
Constant Field Values

DEPEND_

private static final String[] DEPEND_
The dependencies to other objects in the global Environment.

Constructor Detail

RemoteShellServer

public RemoteShellServer()
Creates a new instance.

Method Detail

info

public String info()
Description copied from class: AbstractService
Returns the informative string which should describe the service's essence in a sentence.

Specified by:
info in interface Service
Specified by:
info in class AbstractService
Returns:
the String with the service's short description.

revision

public String revision()
Description copied from class: AbstractService
Returns the revision number of this class as a string. This class provides default implementations of methods majorVersion(), minorVersion based on the assumption that this method returns a revision string as generated by rcs(1) for the template "$Revision: 1.7 $/$Date: 2007-08-08 04:41:53 +0200 (Wed, 08 Aug 2007) $".

Specified by:
revision in class AbstractService

dependencies

public String[] dependencies()
Description copied from class: AbstractService
Returns the dependencies of this service as described in Service. This default implementation returns an array of length 0.

Specified by:
dependencies in interface Service
Overrides:
dependencies in class AbstractService
Returns:
An array of length 0.

protocol

public String protocol()
Specified by:
protocol in interface Server
Specified by:
protocol in class AbstractServer
Returns:
The protocol name; in this case "ssh".

createJob

protected Runnable createJob(Socket connection)
Creates the job that handles the given connection. Subclasses may create special job classes by overriding this method. A return value of null causes the connection to be closed without further processing. Jobs need not close the connection; this is handled by the calling run() method.

Overrides:
createJob in class AbstractServer
Returns:
The new job ready to be run, or null if the connection shall be closed immediately.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.