|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.conn.jco.server.DefaultServerHandlerFactory<T>
public class DefaultServerHandlerFactory<T>
This class is the base for a trivial default implementation of JCoServerFunctionHandlerFactory and JCoServerRequestHandlerFactory. A simple server application or a server application that dispatches only few functions and is not interested in a flexible handling provided by handler factories, may use DefaultServerHandlerFactory.FunctionHandlerFactory or DefaultServerHandlerFactory.RequestHandlerFactory instead of writing own implementations. The implementation of DefaultServerHandlerFactory allows to define handlers for particular functions and/or a generic handler. The generic handler will be invoked only, if no concrete handler for the function module is registered.
| Nested Class Summary | |
|---|---|
static class |
DefaultServerHandlerFactory.FunctionHandlerFactory
Trivial implementation for JCoServerFunctionHandlerFactory. |
static class |
DefaultServerHandlerFactory.RequestHandlerFactory
Trivial implementation for JCoServerRequestHandlerFactory. |
| Field Summary | |
|---|---|
static java.lang.String |
GENERIC_HANDLER
Name for a generic handler implementation. |
| Constructor Summary | |
|---|---|
DefaultServerHandlerFactory()
Creates a new instance for the DefaultServerHandlerFactory. |
|
| Method Summary | |
|---|---|
T |
getCallHandler(JCoServerContext serverCtx,
java.lang.String name)
Depending on the incarnation of the handler factory this methods either implements the required method for JCoServerFunctionHandlerFactory or JCoServerRequestHandlerFactory. |
void |
registerGenericHandler(T handler)
Registers a generic handler with the call handler factory. |
void |
registerHandler(java.lang.String functionName,
T handler)
Registers a call handler with the call handler factory. |
void |
removeGenericHandler()
Unregisters the generic call handler. |
void |
removeHandler(java.lang.String functionName)
Unregisters the call handler for the given function module name. |
void |
sessionClosed(JCoServerContext serverCtx,
java.lang.String message,
boolean error)
This method will be invoked by the JCo runtime, in case a stateful session is going to be closed. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String GENERIC_HANDLER
| Constructor Detail |
|---|
public DefaultServerHandlerFactory()
| Method Detail |
|---|
public void sessionClosed(JCoServerContext serverCtx,
java.lang.String message,
boolean error)
JCoServerCallHandlerFactory interface method
serverCtx - server context of the closing sessionmessage - a message describing the reason, if there is one availableerror - is true if the session was closed because of any errors
public T getCallHandler(JCoServerContext serverCtx,
java.lang.String name)
JCoServerFunctionHandlerFactory or JCoServerRequestHandlerFactory.
serverCtx - additional description for the call contextname - function name for which a call handler is required
public void registerGenericHandler(T handler)
throws java.lang.RuntimeException
handler - the handler to register
java.lang.RuntimeException - in case the registration fails (e.g. a registration for a generic handler already exists)
public void registerHandler(java.lang.String functionName,
T handler)
throws java.lang.RuntimeException
functionName - the function module name for which the handler shall be registeredhandler - the handler to register
java.lang.RuntimeException - in case the registration fails (e.g. a registration for a handler for that function module already exists)
public void removeHandler(java.lang.String functionName)
throws java.lang.RuntimeException
functionName - the function module name that shall be unregistered
java.lang.RuntimeException - in case there was no handler registered
public void removeGenericHandler()
throws java.lang.RuntimeException
java.lang.RuntimeException - in case there was no generic handler registered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||