|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CafeModule
Represents a module in CAFE framework. Each functionality in CAFE is a
module. A module might support one or more types of Communications and/or
UserProcedures.
An implementation of this interface is the basic entry point of any Custom
module to CAFE. For example, if some particular SIP dialogs need to be handled
in a custom way using new types of Communications, a new CafeModule need to be
defined.
Custom CAFE modules should follow the Java Service Provider Interface
mechanism. Any jar which contains a META-INF/services/org.glassfish.cafe.spi.CafeModule
file would be treated as a CAFE module. This file will contain fully qualified name
of the a class that implements this interface.
For each CAFE Java EE application deployed in the container and instance of
CafeModule will be created. During this process, an instance of
CafeModuleRuntime will be passed to the cafeModule.
After initializing the CafeModule, every new
ProtocolMessage and any new Object creation
request will be referred to the module, to check whether the module can handle it.
| Method Summary | ||
|---|---|---|
void |
cleanup()
Framework executes this method, so that any internal housekeeping of the cafeModule can be released. |
|
|
createBuilder(Class<O> type,
CommunicationSession session)
Creates an Object builder for a specified type for a particular CommunicationSession. |
|
Class<?> |
getSupportedType(ProtocolMessage msg)
Get the type of Communication or UserProcedure supported
for the incoming ProtocolMessage. |
|
boolean |
handles(Class<?> type)
Checks whether the module can create an instance of specified CAFE artifact type. |
|
void |
initialize(CafeModuleRuntime cmr)
Initialize the CafeModule with an instance of the CafeModuleRuntime. |
|
| Method Detail |
|---|
void initialize(CafeModuleRuntime cmr)
CafeModule with an instance of the CafeModuleRuntime.
cmr - An instance of CafeModuleRuntimeCafeModuleRuntimeClass<?> getSupportedType(ProtocolMessage msg)
Communication or UserProcedure supported
for the incoming ProtocolMessage. This is typically invoked when an initial
SIP request reaches the CAFE framework.
msg - Incoming ProtocolMessage
Communication or UserProcedure.
This method returns null, if the module cannot handle the message.Communication,
UserProcedure,
ProtocolMessageboolean handles(Class<?> type)
Communication, UserProcedure
or Participant. And subsequently this method can be used to notify the framework
that it can handle the building of these artifacts.
type - This can be any sub-type of Communication, UserProcedure
or Participant.
Communication,
UserProcedure,
ProtocolMessage
<O> CafeObjectBuilder<O> createBuilder(Class<O> type,
CommunicationSession session)
CommunicationSession. The framework will invoke this, only after it finds out
that the module is capable of handling the type, either as a result of invoking the
getSupportedType or handlesmethod.
O - Generic type name of the object to be built.type - Type of the object to be built. This can be any sub-type of Communication,
UserProcedure or Participant.session - an instance of CommunicationSession
CafeObjectBuilderCommunication,
UserProcedure,
ProtocolMessagevoid cleanup()
cafeModule can be released. Typically happens when the Java EE application
is undeployed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||