|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JCoServer
The JCoServer interface provides access to the public APIs in the JCo server implementation.
Applications implementing server applications use the JCoServerFactory to create an instance
of the JCoServer.
Once the server instance is created, the application can customize and then start it.
The connections will be opened asynchronously.
The JCoServer provides the following features:
JCoServerFactory.getServer(String)
Method Summary | |
---|---|
void |
addServerErrorListener(JCoServerErrorListener listener)
Adds a new listener to the list of error listeners. |
void |
addServerExceptionListener(JCoServerExceptionListener listener)
Adds a new listener to the list of exception listeners. |
void |
addServerStateChangedListener(JCoServerStateChangedListener listener)
Adds a new listener to the list of state change listeners. |
JCoServerCallHandlerFactory |
getCallHandlerFactory()
Returns the call handler factory of this server. |
int |
getConnectionCount()
Returns the initial connection count for this server. |
java.lang.String |
getGatewayHost()
Returns the gateway host as defined by the server configuration. |
java.lang.String |
getGatewayService()
Returns the gateway service (or port) as defined by the server configuration. |
JCoServerMonitor |
getMonitor()
Returns a monitor instance describing the server threads and connections that have been created by this server instance. |
java.lang.String |
getMySncName()
Returns the SNC name as defined by the server configuration. |
java.lang.String |
getProgramID()
Returns the program id as defined by the server configuration. |
java.lang.String |
getProperty(java.lang.String key)
Returns the value for a property defined by the server configuration. |
JCoRepository |
getRepository()
Returns the default repository instance used by this server instance. |
JCoRepository |
getRepository(JCoServerContextInfo serverContext)
Returns the repository instance used by this server instance for the specified request context. |
java.lang.String |
getRepositoryDestination()
Returns the repository destination name for obtaining the default repository. |
java.lang.String |
getSAPRouterString()
Returns the SAProuter string as defined by the server configuration. |
JCoServerSecurityHandler |
getSecurityHandler()
Returns the security handler instance of this server. |
JCoServerThreadStarter |
getServerThreadStarter()
Returns the thread starter instance of this server. |
java.lang.String |
getSncLibrary()
Returns the path to the SNC library as defined by the server configuration. |
boolean |
getSncMode()
Returns true if the server is configured to use an SNC connection. |
int |
getSncQOP()
Returns the quality of protection level of SNC as defined by the server configuration. |
JCoServerState |
getState()
Returns the current state of this server. |
JCoThroughput |
getThroughput()
Returns the throughput instance. |
JCoServerTIDHandler |
getTIDHandler()
Returns the TID handler instance of this server. |
JCoServerUnitIDHandler |
getUnitIDHandler()
Returns the unit ID handler instance of this server. |
boolean |
isValid()
Returns true if the corresponding server configuration was neither changed nor removed, false otherwise. |
void |
release()
Releases all resources allocated by the server instance. |
void |
removeServerErrorListener(JCoServerErrorListener listener)
Removes a listener from the list of error listeners. |
void |
removeServerExceptionListener(JCoServerExceptionListener listener)
Removes a listener from the list of exception listeners. |
void |
removeServerStateChangedListener(JCoServerStateChangedListener listener)
Removes a listener from the list of state change listeners. |
void |
removeThroughput()
Removes the throughput instance from this server. |
void |
setCallHandlerFactory(JCoServerCallHandlerFactory callHandlerFactory)
Sets the call handler factory that will be used by the JCo runtime to get a handler instance if a remote call is invoked. |
void |
setConnectionCount(int count)
Sets the number of registered connections managed by this server instance. This API has to be invoked before the start of the server and may be invoked at runtime. |
void |
setRepository(JCoDestination destination)
Sets the destination instance which is used for obtaining the default repository for querying RFC metadata. |
void |
setRepository(JCoRepository repository)
Sets the default repository instance which is being used for querying RFC metadata. |
void |
setRepository(java.lang.String sID,
java.lang.String client,
JCoDestination destination)
Sets the repository destination instance for incoming RFC calls from the system with the system ID sID and - if defined - with the appropriate client. |
void |
setRepository(java.lang.String sID,
java.lang.String client,
JCoRepository repository)
Sets the repository instance for incoming RFC calls from the system with the system ID sID and - if defined - with the appropriate client. |
void |
setSecurityHandler(JCoServerSecurityHandler securityHandler)
Sets the security handler for this server instance. |
void |
setServerThreadStarter(JCoServerThreadStarter starter)
Sets a special instance for the task of starting new threads for this server. |
void |
setThroughput(JCoThroughput throughput)
Sets the throughput instance for measuring the RFC requests dispatched by this server. |
void |
setTIDHandler(JCoServerTIDHandler tidHandler)
Sets the TID handler to be used by this server for incoming transactional and queued RFC requests. |
void |
setUnitIDHandler(JCoServerUnitIDHandler unitIDHandler)
Sets the unit ID handler to be used by this server for incoming background RFC requests. |
void |
start()
Starts the server. The server will open the specified number of connections. |
void |
stop()
Stops the server. All connections will be closed, cached requests will not be processed and aborted. |
Method Detail |
---|
void start()
setConnectionCount(int)
void stop()
setConnectionCount(int)
void setConnectionCount(int count)
Note: In most scenarios 2 connections are enough for a server to serve business calls and 1 connection that is used for technical/administrative purposes.
count
- number of registered connections to manage by the server instanceint getConnectionCount()
void release()
JCoRuntimeException
- in case some workers are still runningJCoRepository getRepository()
JCoRepository getRepository(JCoServerContextInfo serverContext)
serverContext
- request context
void setRepository(JCoDestination destination)
setRepository(JCoRepository)
will be overwritten by this method.
destination
- a destination being used for obtaining the default repositoryvoid setRepository(JCoRepository repository)
setRepository(JCoDestination)
will be overwritten by this method.
repository
- either a custom repository or a repository connected to an ABAP servervoid setRepository(java.lang.String sID, java.lang.String client, JCoDestination destination) throws JCoRuntimeException
setRepository(String, String, JCoRepository)
will be overwritten by this method.
sID
- system ID of the SAP ABAP system containing exactly 3-lettersclient
- null or the client containing exactly 3 digitsdestination
- destination instance to be used for obtaining a repository if sID and client are matching
JCoRuntimeException
- is thrown if sID or client is illegal.void setRepository(java.lang.String sID, java.lang.String client, JCoRepository repository) throws JCoRuntimeException
setRepository(String, String, JCoDestination)
will be overwritten by this method.
sID
- system ID of the SAP ABAP System containing exactly 3-lettersclient
- null or the client containing exactly 3 digitsrepository
- repository instance to be used if sID and client are matching
JCoRuntimeException
- is thrown if sID or client is illegal.java.lang.String getGatewayHost()
java.lang.String getGatewayService()
java.lang.String getSAPRouterString()
/H/<host name>[/S/<port>][/W/<password>]
java.lang.String getProgramID()
boolean getSncMode()
java.lang.String getMySncName()
int getSncQOP()
java.lang.String getSncLibrary()
java.lang.String getProperty(java.lang.String key)
key
- property key for looking up the property value to return
java.lang.String getRepositoryDestination()
void setCallHandlerFactory(JCoServerCallHandlerFactory callHandlerFactory)
A factory for the call handlers is required. The server instance cannot be started
unless a factory has been set.
callHandlerFactory must be an instance of JCoServerRequestHandlerFactory or
JCoServerFunctionHandlerFactory, otherwise a JCoRuntimeException will be thrown.
callHandlerFactory
- call handler factory to be used by the serverDefaultServerHandlerFactory
JCoServerCallHandlerFactory getCallHandlerFactory()
void setTIDHandler(JCoServerTIDHandler tidHandler)
RFC requests being sent "in background task" (tRFC) or with the queue extension (qRFC)
are identified by a unique TID (Transaction ID).
To ensure proper TID handling and to separate the TID handling from the application logic,
the method handling with TIDs are gathered in the JCoServerTIDHandler interface.
Each application dispatching tRFC or qRFC calls has to implement and set an appropriate
JCoServerTIDHandler instance.
tidHandler
- instance providing the TID handlingJCoServerTIDHandler getTIDHandler()
null
if none is setvoid setUnitIDHandler(JCoServerUnitIDHandler unitIDHandler)
RFC requests being sent "in background unit" (bgRFC) are identified by a unique unit ID.
The treatment of unit IDs is similar to the TID handling. To ensure that the
application is aware of the differences in the TID and unit ID handling, the unit ID
handling is defined separately by the interface JCoServerUnitIDHandler.
Each application dispatching bgRFC calls has to implement and set an appropriate
JCoServerUnitIDHandler instance.
unitIDHandler
- instance providing the unit ID handlingJCoServerUnitIDHandler getUnitIDHandler()
null
if none is setvoid setSecurityHandler(JCoServerSecurityHandler securityHandler)
The security handler will be invoked by the JCo runtime to check the permissions of the user who initiated the RFC request.
Note: Once the security handler is set it is not possible to change it due to security reasons. The only way to change the implementation of the security handler is to create and start another server instance.
securityHandler
- security handler to be used by the serverJCoServerSecurityHandler getSecurityHandler()
null
if none is setvoid setServerThreadStarter(JCoServerThreadStarter starter)
In some runtime environments starting new threads via Thread.start()
is not allowed and may be done with using special APIs only. For this case
the application can provide its own implementation for starting new server threads.
starter
- instance for starting new server worker threadsJCoServerThreadStarter getServerThreadStarter()
null
if none is setvoid addServerErrorListener(JCoServerErrorListener listener)
If a listener is added to the list of error listeners during firing an event, it won't be notified about this event.
listener
- the error listener to addremoveServerErrorListener(com.sap.conn.jco.server.JCoServerErrorListener)
void addServerExceptionListener(JCoServerExceptionListener listener)
If a listener is added to the list of exception listeners during firing an event, it won't be notified about this event.
listener
- the listener to addremoveServerExceptionListener(com.sap.conn.jco.server.JCoServerExceptionListener)
void addServerStateChangedListener(JCoServerStateChangedListener listener)
If a listener is added to the list of state change listeners during firing an event, it won't be notified about this event.
listener
- the listener to addremoveServerStateChangedListener(com.sap.conn.jco.server.JCoServerStateChangedListener)
void removeServerErrorListener(JCoServerErrorListener listener)
If a listener is removed from the list of error listeners during firing an event, it will be still notified about this event.
listener
- the listener to removeaddServerErrorListener(com.sap.conn.jco.server.JCoServerErrorListener)
void removeServerExceptionListener(JCoServerExceptionListener listener)
If a listener is removed from the list of exception listeners during firing an event, it will be still notified about this event.
listener
- the listener to removeaddServerExceptionListener(com.sap.conn.jco.server.JCoServerExceptionListener)
void removeServerStateChangedListener(JCoServerStateChangedListener listener)
If a listener is removed from the list of state change listeners during firing an event, it will be still notified about this event.
listener
- the listener to removeaddServerStateChangedListener(com.sap.conn.jco.server.JCoServerStateChangedListener)
void setThroughput(JCoThroughput throughput)
throughput
- the throughput instance for storing the performance dataJCoThroughput getThroughput()
void removeThroughput()
JCoServerMonitor getMonitor()
JCoServerState getState()
boolean isValid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |