|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.tspaces.server.TSServer
TSServer is the main daemon process that serves requests for TupleSpace clients. TSServer listens on a port (default 8200) and, for each connection, creates a thread (TSIOHandler) to talk with each connecting client. TSIOHandler reads in the command tuple, then fires up a TSDispatch thread to actually do whatever the client requested. The TSIOHandler then gets ready for the next request from the client. TSDispatch will process the command tuple from the client. The command tuple has three fields, the first is a String with the name of the TS, the second is a String with the name of a command, and the third is a "data" Tuple, ie., the Tuple to be operated on by the command in the context of the Tuple Space. TSDispatch locates the TS and then asks it to process the command given the data tuple. The TS takes the commnad string and gives it to an instance of TSFactory that returns an instance of TSHandler, it is this instance that implements the actual command.
+--------+ +-----------+----------+ | | Open Socket | | galaxyTS | | Client |-------------| TS Server +----------+ | | | | +--------+ +-----------+The Client opens a socket on a port that the TS Server is listening to. The TSServer immediately fires off a thread, running TSIOHandler, to handle the new conversation.
+--------+ +-----------+----------+
| | | | galaxyTS |
| Client |-------------| TS Server +----------+
| | | |
+--------+ +-----------+
|
+-----------------------+
| TS IOHandler| TSG ref |
+-----------------------+
The TS Dispatch thread is passed a pointer to the TupleSpace
Galaxy, which resides in the TS Server.
The central database root is the galaxyTS. The TSG has several "built-in" databases along with the user-defined databases.
(*) The ADMIN database, tracks users, groups, permissions and passwords. The ability to create and delete TupleSpaces is controled by the ADMIN database.
(*) The GALAXY database tracks all of the TupleSpaces (TS) for this server. NOTE: TS Servers are currently autonomous entities, but eventually they will collaborate to form the TS Universe.
TSServer Operation
TSServer.main() get control from the command line entry. It parses the various command line switches and then creates an instance of TSServer. Since TSServer is a Runnable class, it then does a start to get a new thread running. It then issues a prompt to STDIN and waits for possible subcommands.
The TSpaces constructor use the information that is either passed to the construtor as parameters or is in the Configuration file to start up the pieces of the TSServer.
Setup Checkpointing Setup Debug and Log options Setup HTTP Server Setup Galaxy space Setup Admin Space Setup FileStore
When the run() method gets control, it listens on a port (default 8200) and, for each connection, creates a thread (TSIOHandler) to talk with each connecting client.
TS,
TSDispatch,
TSDB,
TSFactory,
TSIOHandler,
TupleSpace,
Tuple| Field Summary | |
static boolean |
_CHECK_PERMISSIONS
should the server be in checking access permissions mode? see TS.command to see where this is used. |
static boolean |
_DEBUG
is debugging on the server on or off?? |
static boolean |
_DEBUG_COMMUNICATION
|
static boolean |
_DEBUG_SECURITY
if _DEBUG_SECURITY is true then additional debug info relating to authorization and access permissions will be produced. |
static boolean |
_exit
This flag is set true when it is signalled that we want to exit. |
static java.lang.String |
_GALAXY_DBTYPE
what type is the galaxy? Must know for recovery as well as creating it the first time The galaxy tells us the types of the rest of the spaces. |
static java.lang.String |
_SERVER_VERSION
Code Version.Level.Modification Change this when a new level of code is to be released |
protected boolean |
_shutdown
indicates that shutdown is in process so no new sessions should be started |
protected int |
connectCounter
counts the number of connections. |
static java.lang.String |
CREATE_ACL
Name for Create_Acl |
static java.lang.String |
DEFAULT_ACL
Name for Default Acl |
protected static java.lang.String |
DEFAULT_CONFIG_FILENAME
Configuration object. |
protected java.lang.String |
hostName
The name and IP address of the host that the server is running on. |
protected static boolean |
HTTP_ADMIN_OK
This flag will allow or disallow Admin and Erase freatures from the HTTP server. |
protected int |
httpPort
|
protected com.ibm.tspaces.server.http.HTTPServer |
httpServer
|
protected static boolean |
HTTPServerSupport
This flag controls whether or not a HTTP server is started. |
protected java.lang.String |
ipAddress
|
protected com.ibm.tspaces.server.util.Log |
logFile
The logfile for the server. |
protected int |
port
The port that the server listens on for new connections from client TupleSpaces. |
protected java.lang.Runtime |
runTime
Source of information about the java VM |
protected java.util.Date |
startTime
The time that server started execution. |
| Fields inherited from interface com.ibm.tspaces.ac.AclFactory.DefaultPermissions |
P_ADMIN,
P_ALL,
P_CREATE,
P_READ,
P_RW,
P_RWC,
P_WRITE |
| Constructor Summary | |
TSServer()
Create a TSServer using the default parameters. |
|
TSServer(int port_,
java.lang.String checkpointDir_,
boolean freshStart_,
double checkpointInterval_,
java.lang.String configFile)
Create a TSServer using the specified parameters It will use the information that is either passed to the construtor as parameters or is in the Configuration file to start up the pieces of the TSServer. |
|
| Method Summary | |
com.ibm.tspaces.server.TS |
admin()
Return the admin space for this TSServer. |
java.lang.String |
debugHostPort()
Return a string that combines the ip address of this host with the port on which the HTTP server is listen for conections. |
com.ibm.tspaces.server.TS |
galaxy()
Return the galaxy space for this TSServer. |
TsAclDBase |
getAclDBase()
TsAclDBase aclDB = null; Return the AclDB object for this TSServer. |
static AuthChecker |
getAuthChecker()
Return a reference to the Authentication checker object |
static com.ibm.tspaces.server.util.Configuration |
getConfiguration()
Return a reference to the Configuration object that contains the information read from the Config file |
java.security.acl.Acl |
getCreateAcl()
Return the Create Acl for this TSServer. |
java.security.acl.Acl |
getDefaultAcl()
Return the Default Acl for this TSServer. |
void |
getDefaultAcl(java.security.acl.Acl defaultAcl)
Update the Default Acl for this TSServer. |
int |
getHandlerCount()
Return the count of active TSIOHandler Threads. |
java.lang.String |
getHostName()
Return the name of the host the server is running on. |
static com.ibm.tspaces.lock.LockManager |
getLockMgr()
Return a reference to the current lock manager |
static TSServer |
getRef()
Return a reference to the current TSServer instance If it returns null then maybe you are a client and not a server but if you are running a client in the same Java Virtual Machine as the server than you would get the refernce to the server even though you are just a lowly client. |
java.lang.String |
getServerHostPort()
Return a string that combines the ip address of this host with the port on which the server is listening for conections. |
static com.ibm.tspaces.server.TransactionManager |
getTransMgr()
Return a reference to the current transaction manager |
int |
getUpdateCount()
This returns a counter that is incremented when the ACL and/or usertable has been updated. |
static java.lang.String |
getVersion()
Return the version string for the server |
void |
incrementUpdateCount()
The TSHAdmin SetUpdateFlag command will invoke this method as a signal that the User and/or ACL information has changed. |
static boolean |
isShutdown()
Return the shutdown status |
void |
log(java.util.Properties props)
Deposit the stack trace of the thrown error or exception into the log. |
void |
log(java.lang.String string)
Deposit the string into the log. |
void |
log(java.lang.Throwable t)
Deposit the stack trace of the thrown error or exception into the log. |
static void |
main(java.lang.String[] args_)
The main entry point for the TSServer Program. |
void |
run()
The execution entry point for this thread. |
void |
shutdown(int time_)
Start the TSpaces shutdown process. |
void |
startRMIServer()
Starts the RMI server and registers the remote methods to the Registry. |
java.lang.String |
status()
Generate a string that contains useful status info |
java.lang.String |
toString()
Enhanced toString method to give useful status info |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final java.lang.String _SERVER_VERSION
public static boolean _CHECK_PERMISSIONS
public static boolean _DEBUG
public static boolean _DEBUG_COMMUNICATION
public static boolean _DEBUG_SECURITY
public static final java.lang.String DEFAULT_ACL
public static final java.lang.String CREATE_ACL
public static final java.lang.String _GALAXY_DBTYPE
protected static boolean HTTP_ADMIN_OK
protected static boolean HTTPServerSupport
public static boolean _exit
protected static final java.lang.String DEFAULT_CONFIG_FILENAME
protected int port
protected com.ibm.tspaces.server.util.Log logFile
protected java.lang.Runtime runTime
protected java.util.Date startTime
protected java.lang.String hostName
protected java.lang.String ipAddress
protected int httpPort
protected com.ibm.tspaces.server.http.HTTPServer httpServer
protected int connectCounter
protected boolean _shutdown
| Constructor Detail |
public TSServer()
throws TupleSpaceException,
com.ibm.tspaces.server.RollbackException,
com.ibm.tspaces.server.CheckpointException,
com.ibm.tspaces.lock.LMAbortedException
public TSServer(int port_,
java.lang.String checkpointDir_,
boolean freshStart_,
double checkpointInterval_,
java.lang.String configFile)
throws TupleSpaceException,
com.ibm.tspaces.server.RollbackException,
com.ibm.tspaces.server.CheckpointException,
com.ibm.tspaces.lock.LMAbortedException
port_ - The port that the TSServer will listen on.checkpointDir_ - the directory to be used for checkpointingfreshStart_ - set true if the server should ignore any checkpoint on disk?checkpointInterval_ - how often to dump the databases to disk.configFile - is the file name for the configuration file.| Method Detail |
public static java.lang.String getVersion()
public static com.ibm.tspaces.server.util.Configuration getConfiguration()
public static TSServer getRef()
public static com.ibm.tspaces.lock.LockManager getLockMgr()
public static com.ibm.tspaces.server.TransactionManager getTransMgr()
public static AuthChecker getAuthChecker()
public void startRMIServer()
throws java.rmi.RemoteException
public int getUpdateCount()
public void incrementUpdateCount()
throws com.ibm.tspaces.lock.LMAbortedException
public com.ibm.tspaces.server.TS galaxy()
public com.ibm.tspaces.server.TS admin()
public java.security.acl.Acl getDefaultAcl()
public void getDefaultAcl(java.security.acl.Acl defaultAcl)
defaault - ACLpublic java.security.acl.Acl getCreateAcl()
public TsAclDBase getAclDBase()
public java.lang.String getServerHostPort()
public java.lang.String debugHostPort()
public java.lang.String getHostName()
public int getHandlerCount()
public void run()
It will do the following:
- Setup a ServerSocket instance on the specified port
- Startup a checkpointManager thread
- Startup the HTTP server
- Sit in a loop
- get incomming client socket
- start TSIOHandler thread
public void shutdown(int time_)
Inform the TSIOHandlers that a shutdown is in process
wait for period of time for application shutdown
Inform the TSIOHandler to shutdown. This is a signal that the IOHandler should abort any remaining transactions.
wait for period of time for application abort operations
invoke the checkpoint.shutdown(). This will take a checkpoint and terminate wait for period of time for application shutdown
TSServer will wait for the CheckpointManager to terminate and then System.exit exit
time - The time in seconds to allow for shutdownpublic static boolean isShutdown()
public void log(java.lang.String string)
string - the string.public void log(java.lang.Throwable t)
t - the Exception or Error to be logged.public void log(java.util.Properties props)
t - the Exception or Error to be logged.public java.lang.String status()
public java.lang.String toString()
public static void main(java.lang.String[] args_)
Usage: com.ibm.tspaces.server [options]
Options:
[-a password] Specify sysadmin password
[-b] boot TSpaces from scratch
[-B] boot TSpaces and userinfo from scratch
[-c configurationFilename] Configuration filepath
[-d writabledirectory] specify a checkpoint directory
[-p port#] specify a port number
[-i double] specify a checkpoint interval
[-D] Turn on Debug output
[-Dmax] Turn on Maximum Debug support
[-S] Enable the HTTP Server interface
[-A] Enable Administrative HTTP functions
-A implies -S
[-noPrompt] disable prompt for subcommands
Note that the spaces after flags are required. );
args_ - Arguments from the command line. See above
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||