Novell exteNd Web Services SDK API

com.sssw.jbroker.web.portable
Class MDBSkeleton

java.lang.Object
  extended bycom.sssw.jbroker.web.portable.MDBSkeleton
All Implemented Interfaces:
InvokeHandler, MessageListener, Referenceable, Serializable, ServiceObject, Skeleton

public abstract class MDBSkeleton
extends Object
implements MessageListener, Skeleton

The Message Driven Bean (MDB) skeleton is the base class of all Web Service implementation that are realized using a MDB.

Since:
jBroker Web 2.1
See Also:
Serialized Form

Nested Class Summary
static interface MDBSkeleton.MDBDelegate
          The base class delegates the JMS messages to this interface.
 
Field Summary
static int QUEUE
          Constant for a reply queue
static int TOPIC
          Constant for a reply topic
 
Fields inherited from interface com.sssw.jbroker.web.portable.Skeleton
TEST_DISABLE
 
Method Summary
 Binding[] _getBindings()
          Get the bindings set on this skeleton
 ClassInfo _getClassInfo()
          Get dispatch information for this service object
 Binding _getCurrentBinding()
          Get the binding currently used by this skeleton
 List _getHandlerChain()
          Get the handler chain set on this servlet skeleton
 QName _getOperationName()
          Get the operations's QName
 QName _getPortType()
          Get the port's QName
 Object _getProperty(String propName)
          Get a property
 Stub _getStub()
          Get servlet as stub
 TypeMapper _getTypeMapper()
          Deprecated. As of jBroker Web 2.0, use _getTypeMappingRegistry instead
 TypeMappingRegistry _getTypeMappingRegistry()
          Get the type mapping registry set on this serlvet skeleton
 ServerResponse _invoke(Properties props, InputStream is)
          Implementation of InvokeHandler.invoke(Properties props, InputStream is)
 void _setClassInfo(ClassInfo info)
          Set dispatch information for this service object
 void _setCurrentBinding(Binding binding)
          Set the binding on this skeleton
 void _setHandlerChain(HandlerChain chain)
          Set the HandlerChain for the Stub
 void _setHandlerChain(List handlerChain)
          Set the handler chain on this servlet skeleton.
 String _setProperty(String propName, String propValue)
          Set a property
 void _setTypeMapper(TypeMapper typeMapper)
          Deprecated. As of jBroker Web 2.0, use _setTypeMappingRegistry instead
 void _setTypeMappingRegistry(TypeMappingRegistry typeMapper)
          Set the type mapping registry on this serlvet skeleton
 void ejbCreate()
          The MDB's ejbCreate method is delegated to the delegate.
 void ejbRemove()
          The MDB's ejbRemove method is delegated to the delegate.
 Connection getConnection(int type)
          This method retrieves a connection when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method).
 ConnectionFactory getConnectionFactory(int type)
          This method retrieves a connection factory when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method).
 MessageProducer getProducer(Destination dest, int type)
          This method retrieves a message producer when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method).
 Reference getReference()
           
 Session getSession(int type)
          This method retrieves a session when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method).
 void init()
           
 void onMessage(Message m)
          The MDB's onMessage method is delegated to the delegate.
 void setMessageDrivenContext(MessageDrivenContext ctx)
          The MDB's setMessageDrivenContext method is delegated to the delegate.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sssw.jbroker.web.portable.InvokeHandler
_invoke, isDocument
 

Field Detail

QUEUE

public static final int QUEUE
Constant for a reply queue

See Also:
Constant Field Values

TOPIC

public static final int TOPIC
Constant for a reply topic

See Also:
Constant Field Values
Method Detail

init

public void init()
          throws ServletException
Throws:
ServletException

_getStub

public Stub _getStub()
Get servlet as stub

Returns:
a Stub object for self

getReference

public Reference getReference()
                       throws NamingException
Specified by:
getReference in interface Referenceable
Throws:
NamingException

_getTypeMapper

public TypeMapper _getTypeMapper()
Deprecated. As of jBroker Web 2.0, use _getTypeMappingRegistry instead

Get the type mapper set on this serlvet skeleton

Specified by:
_getTypeMapper in interface ServiceObject
Returns:
a TypeMapper object
See Also:
_getTypeMappingRegistry()

_setTypeMapper

public void _setTypeMapper(TypeMapper typeMapper)
Deprecated. As of jBroker Web 2.0, use _setTypeMappingRegistry instead

Set the type mapper on this serlvet skeleton

Specified by:
_setTypeMapper in interface ServiceObject
Parameters:
typeMapper - a TypeMapper object with type mappings to be used by this servlet skeleton
See Also:
_setTypeMappingRegistry(TypeMappingRegistry)

_getTypeMappingRegistry

public TypeMappingRegistry _getTypeMappingRegistry()
Get the type mapping registry set on this serlvet skeleton

Specified by:
_getTypeMappingRegistry in interface ServiceObject
Returns:
a TypeMappingRegistry object
Since:
jBroker Web 2.0

_setTypeMappingRegistry

public void _setTypeMappingRegistry(TypeMappingRegistry typeMapper)
Set the type mapping registry on this serlvet skeleton

Specified by:
_setTypeMappingRegistry in interface ServiceObject
Parameters:
typeMapper - a TypeMappingRegistry object with type mappings to be used by this servlet skeleton
Since:
jBroker Web 2.0

_getPortType

public QName _getPortType()
Get the port's QName

Specified by:
_getPortType in interface ServiceObject
Returns:
a QName for the port that defined this skeleton

_getBindings

public Binding[] _getBindings()
Get the bindings set on this skeleton

Specified by:
_getBindings in interface ServiceObject
Returns:
an array of Binding objects

_getCurrentBinding

public Binding _getCurrentBinding()
                           throws ServiceException
Get the binding currently used by this skeleton

Specified by:
_getCurrentBinding in interface ServiceObject
Returns:
the current Binding object
Throws:
ServiceException - if serlvet is not activated yet

_setCurrentBinding

public void _setCurrentBinding(Binding binding)
                        throws MalformedURLException
Set the binding on this skeleton

Specified by:
_setCurrentBinding in interface ServiceObject
Parameters:
binding - a Binding object
Throws:
MalformedURLException - always raises this exception since the binding can not be changed on a skeleton

_getProperty

public Object _getProperty(String propName)
Get a property

Specified by:
_getProperty in interface ServiceObject
Parameters:
propName - the property name
Returns:
the property value

_setProperty

public String _setProperty(String propName,
                           String propValue)
Set a property

Specified by:
_setProperty in interface ServiceObject
Parameters:
propName - the property name
propValue - the property value
Returns:
previous property value (if any)

_setHandlerChain

public void _setHandlerChain(List handlerChain)
Set the handler chain on this servlet skeleton.

Specified by:
_setHandlerChain in interface Skeleton
Parameters:
handlerChain - a standard handler chain
Since:
jBroker Web 2.0

_getHandlerChain

public List _getHandlerChain()
Get the handler chain set on this servlet skeleton

Returns:
a standard handler chain
Since:
jBroker Web 2.0

_setHandlerChain

public void _setHandlerChain(HandlerChain chain)
Description copied from interface: ServiceObject
Set the HandlerChain for the Stub

Specified by:
_setHandlerChain in interface ServiceObject
Parameters:
chain - the HandlerChain.

_setClassInfo

public void _setClassInfo(ClassInfo info)
Set dispatch information for this service object

Specified by:
_setClassInfo in interface ServiceObject
Parameters:
info - the class info
Since:
jBroker Web 2.0

_getClassInfo

public ClassInfo _getClassInfo()
Description copied from interface: ServiceObject
Get dispatch information for this service object

Specified by:
_getClassInfo in interface ServiceObject
Returns:
the class info
Since:
jBroker Web 2.0

_getOperationName

public QName _getOperationName()
Description copied from interface: ServiceObject
Get the operations's QName

Specified by:
_getOperationName in interface ServiceObject
Returns:
the operation Name
Since:
jBroker Web 2.0

_invoke

public ServerResponse _invoke(Properties props,
                              InputStream is)
                       throws IOException
Implementation of InvokeHandler.invoke(Properties props, InputStream is)

Specified by:
_invoke in interface InvokeHandler
Parameters:
props - transport header iformation
is - input stream to read
Returns:
a specialized server response output stream
Throws:
IOException - if an I/O exception occurred during invoke

ejbCreate

public void ejbCreate()
The MDB's ejbCreate method is delegated to the delegate. If you override this method to do additional bean initialization, you should call super.ejbCreate to ensure the delegate is properly initialized.


setMessageDrivenContext

public void setMessageDrivenContext(MessageDrivenContext ctx)
The MDB's setMessageDrivenContext method is delegated to the delegate. Override this method to get access to the context.

Parameters:
ctx - the message driven context object

onMessage

public void onMessage(Message m)
The MDB's onMessage method is delegated to the delegate. Normally, you would not override this method since it is responsible for the message dispatch. If you override this method, you must call super.onMessage to ensure proper message dispatch. If you want to filter the messages that get dispatched as SOAP messages, you might do:
  public void onMessage(Message m)
  {
     if (m instanceof TextMessage)
         super.onMessage(m);
     else
         // your processing here ...
  }
 

Specified by:
onMessage in interface MessageListener
Parameters:
m - the JMS message

ejbRemove

public void ejbRemove()
The MDB's ejbRemove method is delegated to the delegate. Override this method to perform bean removal functions.


getConnectionFactory

public ConnectionFactory getConnectionFactory(int type)
                                       throws JMSException
This method retrieves a connection factory when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method). The default implementation of this method will return a jBroker MQ specified connection factory. Implementations may wish to override this method to use e.g. JNDI to lookup the connection factory.

Parameters:
type - the connection factory type (QUEUE for queue and TOPIC for topic)
Returns:
a connection factory object according to type
Throws:
JMSException - if a factory could not be created

getConnection

public Connection getConnection(int type)
                         throws JMSException
This method retrieves a connection when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method). The default implementation of this method simply calls getConnectionFactory and invokes the createQueueConnection or createTopicConnection method depending on the destination type. Implementations may wish to override this method if they for instance need to specified a username and password when creating the connection.

Parameters:
type - the connection type (QUEUE for queue and TOPIC for topic)
Returns:
a connection object according to type
Throws:
JMSException - if a connection could not be created

getSession

public Session getSession(int type)
                   throws JMSException
This method retrieves a session when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method). The default implementation of this method simply calls getConnection and invokes the createQueueSession or createTopicSession method depending on the destination type. Implementations would normally not override this method.

Parameters:
type - the session type (QUEUE for queue and TOPIC for topic)
Returns:
a session object according to type
Throws:
JMSException - if a session could not be created

getProducer

public MessageProducer getProducer(Destination dest,
                                   int type)
                            throws JMSException
This method retrieves a message producer when an incoming message contains a reply destination (as per invoking the getJMSReplyTo method). The default implementation of this method simply calls getSession and invokes the createSender or createPublisher method depending on the destination type. Also, a new message producer will be created in these two circumstances: Implementations may wish to override this method if they for instance wish to cache message producers more effectively.

Parameters:
type - the message producer type (QUEUE for queue and TOPIC for topic)
Returns:
a message producer object according to type
Throws:
JMSException - if a producer could not be created

Novell exteNd Web Services SDK API

exteNd is a registered trademark of Novell, Inc.
Copyright 1998-2003 Novell, Inc. All Rights Reserved.