|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.registry.jdbc.handlers.HandlerManager
public class HandlerManager
Manages the handlers and thier invocations. Handlers, which are required to be invoked must be registered with this class using the addHanlder(...) method. Handlers are allowed for a subset of Registry API methods (see Java doc of Handler class for more detrails). Handler authors can further specify exactly for which methods thier handlers should engage. For example, handler author may specify his handler should be engaged only for GET and DELETE operations. This class maintains separate maps for each supported operation and puts handlers to corresponding maps once registered. Handlers are registered with a Filter instance. Filter decides (based on the request) whether or not to invoke its associated handler. This class has a separate method for each supported operation. These methods are invoked by BasicRegistry once such method is invoked in the Registry API. Then this class iterates through the map corresponding to the invoked method and evalautes filters of registered handlers. For each filter which evaluates to true, its associated handler will be invoked. This process continues either till there is no more handlers or till the processingComplete parameter of the RequestContext is set to true. There is only one instance of this class exists per registry instance.
Constructor Summary | |
---|---|
HandlerManager()
|
Method Summary | |
---|---|
void |
addHandler(java.lang.String[] methods,
Filter filter,
Handler handler)
Registers handlers with the handler manager. |
void |
delete(RequestContext requestContext)
Manages the handler invocations of DELETE method. |
Resource |
get(RequestContext requestContext)
Manages the handler invocations of GET method. |
void |
importChild(RequestContext requestContext)
Manages the handler invocations of IMPORT_CHILD method. |
java.lang.String |
importResource(RequestContext requestContext)
Manages the handler invocations of IMPORT method. |
java.lang.String |
put(RequestContext requestContext)
Manages the handler invocations of PUT method. |
void |
putChild(RequestContext requestContext)
Manages the handler invocations of PUT_CHILD method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HandlerManager()
Method Detail |
---|
public void addHandler(java.lang.String[] methods, Filter filter, Handler handler)
methods
- Methods for which the registered handler should be engaged. Allowed values in
the string array are "GET", "PUT", "IMPORT", "DELETE", "PUT_CHILD", and "IMPORT_CHILD".
If null is given, handler will be engaged to all methods.filter
- Filter instance associated with the handler.handler
- Handler instance to be registered.public Resource get(RequestContext requestContext) throws RegistryException
requestContext
- Details of the request.
RegistryException
- This exception is thrown for all exceptions occured inside
handlers or filters.public java.lang.String put(RequestContext requestContext) throws RegistryException
requestContext
- Details of the request.
RegistryException
- This exception is thrown for all exceptions occured inside
handlers or filters.public java.lang.String importResource(RequestContext requestContext) throws RegistryException
requestContext
- Details of the request.
RegistryException
- This exception is thrown for all exceptions occured inside
handlers or filters.public void delete(RequestContext requestContext) throws RegistryException
requestContext
- Details of the request.
RegistryException
- This exception is thrown for all exceptions occured inside
handlers or filters.public void putChild(RequestContext requestContext) throws RegistryException
requestContext
- Details of the request.
RegistryException
- This exception is thrown for all exceptions occured inside
handlers or filters.public void importChild(RequestContext requestContext) throws RegistryException
requestContext
- Details of the request.
RegistryException
- This exception is thrown for all exceptions occured inside
handlers or filters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |