flex.messaging.services.remoting.adapters
Class JavaAdapter

java.lang.Object
  extended by flex.management.ManageableComponent
      extended by flex.messaging.services.ServiceAdapter
          extended by flex.messaging.services.remoting.adapters.JavaAdapter
All Implemented Interfaces:
Manageable, FlexComponent, FlexConfigurable

public class JavaAdapter
extends ServiceAdapter

Basic adapter for invoking methods on a Java object. By default, it is stateless, in that a new object is instantiated for each request. If the destination configuration contains a stateful flag, the HTTP session is searched for an existing instance of the object, so multiple requests from the same client will be invoked on a stateful component.

Methods are cached, so requests subsequent to the initial creation/invocation will perform much better than will the initial invocation.


Field Summary
static String[] PROTECTED_PACKAGES
           
 
Constructor Summary
JavaAdapter()
          Constructs an unmanaged JavaAdapter instance.
JavaAdapter(boolean enableManagement)
          Constructs a JavaAdapter instance.
 
Method Summary
 Object invoke(Message message)
          Handle a data message intended for this adapter.
 void setDestination(Destination destination)
          Casts the Destination into RemotingDestination and calls super.setDestination
 void start()
          Starts the adapter if its associated Destination is started and if the adapter is not already running.
 
Methods inherited from class flex.messaging.services.ServiceAdapter
getAdapterState, getDestination, handlesSubscriptions, manage, setAdapterState, stop
 
Methods inherited from class flex.management.ManageableComponent
getControl, getId, getParent, initialize, isManaged, isStarted, isValid, setControl, setId, setManaged, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTECTED_PACKAGES

public static final String[] PROTECTED_PACKAGES
Constructor Detail

JavaAdapter

public JavaAdapter()
Constructs an unmanaged JavaAdapter instance.


JavaAdapter

public JavaAdapter(boolean enableManagement)
Constructs a JavaAdapter instance.

Parameters:
enableManagement - true if the JavaAdapter has a corresponding MBean control for management; otherwise false.
Method Detail

start

public void start()
Description copied from class: ServiceAdapter
Starts the adapter if its associated Destination is started and if the adapter is not already running. If subclasses override, they must call super.start().

Specified by:
start in interface FlexComponent
Overrides:
start in class ServiceAdapter

setDestination

public void setDestination(Destination destination)
Casts the Destination into RemotingDestination and calls super.setDestination

Overrides:
setDestination in class ServiceAdapter
Parameters:
destination -

invoke

public Object invoke(Message message)
Description copied from class: ServiceAdapter
Handle a data message intended for this adapter. This method is responsible for handling the message and returning a result (if any). The return value of this message is used as the body of the acknowledge message returned to the client. It may be null if there is no data being returned for this message.

Typically the data content for the message is stored in the body property of the message. The headers of the message are used to store fields which relate to the transport of the message. The type of operation is stored as the operation property of the message.

Specified by:
invoke in class ServiceAdapter
Parameters:
message - the message as sent by the client intended for this adapter
Returns:
the body of the acknowledge message (or null if there is no body)
See Also:
Message, AsyncMessage


Copyright © 2007 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/services/remoting/adapters/JavaAdapter.html