flex.data.adapters
Class JavaAdapter

java.lang.Object
  extended by flex.management.ManageableComponent
      extended by flex.messaging.services.ServiceAdapter
          extended by flex.data.adapters.JavaAdapter
All Implemented Interfaces:
flex.data.adapters.JavaAdapterConstants, Manageable, FlexComponent, FlexConfigurable, MessagingSecurity
Direct Known Subclasses:
ASObjectAdapter

public class JavaAdapter
extends ServiceAdapter
implements flex.data.adapters.JavaAdapterConstants, MessagingSecurity

DataAdapter for employing Java objects as a service tier for DataCollection operations. The adapter handles incoming messages and hands the data to Assembler implementions which integrate with the persistence store.


Nested Class Summary
 class JavaAdapter.FillMethod
          A class that represents JavaAdapter fill methods.
 class JavaAdapter.GetMethod
          A class that represents JavaAdapter get methods.
 class JavaAdapter.QueryMethod
          A class that represents JavaAdapter query methods (count methods).
 
Field Summary
 String LOG_CATEGORY
          Log category for JavaAdapter.
 
Fields inherited from interface flex.data.adapters.JavaAdapterConstants
AUTO_REFRESH_ELEMENT, CONFLICT_MODE_DEFAULT, CONFLICT_MODE_DELETE_ATTR, CONFLICT_MODE_UPDATE_ATTR, COUNT_ELEMENT, FILL_CONTAINS_METHOD_ELEMENT, FILL_ELEMENT, GET_ELEMENT, METHOD_NAME_ELEMENT, ORDERED_ELEMENT, PARAM_TYPES_ELEMENT, SECURITY_CONSTRAINT_ELEMENT, SECURITY_REF_ATTR, SECURITY_RUN_AS_ELEMENT, SYNC_ELEMENT
 
Constructor Summary
JavaAdapter()
          Constructs an unmanaged JavaAdapter instance.
JavaAdapter(boolean enableManagement)
          Constructs a JavaAdapter instance.
 
Method Summary
 void addCountMethod(String name)
          Adds a count method.
 void addCountMethod(String name, String params)
          Adds a count method.
 void addFillMethod(String name)
          Adds a fill method.
 void addFillMethod(String name, String params)
          Adds a fill method.
 void addFillMethod(String name, String params, boolean autoRefresh, boolean ordered, String fillContainsName)
          Adds a fill method .
 boolean allowSend(Subtopic subtopic)
          This method is invoked before a client message is sent to a subtopic, so that custom application logic can determine whether the client should be allowed to send to the specified subtopic.
 boolean allowSubscribe(Subtopic subtopic)
          Need a hook so that the customer can provide messaging security.
 boolean fillNeedsAutoRefresh(Object args)
          This method is called directly from the data service (not using the messaging abstraction.
 List getCountMethods()
          Returns the list of count methods which are of QueryMethod types.
 List getFillMethods()
          Returns the list of fill methods.
 JavaAdapter.GetMethod getGetMethod()
          Returns the get method.
 SecurityConstraintManager getSecurityConstraintManager()
          Gets the SecurityConstraintManager of the JavaAdapter.
 Method getSyncMethod()
          Returns the sync method.
 void initialize(String id, ConfigMap properties)
          Initializes the JavaAdapter with the properties.
 Object invoke(Message message)
          Handle a data message intended for this adapter.
 void setDestination(Destination destination)
          Casts the Destination into DataDestination and calls super.setDestination.
 void setGetMethod(String name)
          Sets the get method.
 void setSecurityConstraintManager(SecurityConstraintManager constraintManager)
          Sets the SecurityConstraintManager of the JavaAdapter.
 void setSyncMethod(String name)
          Sets the sync method.
 void start()
          Starts the adapter.
 void stop()
          Stops the adapter.
 
Methods inherited from class flex.messaging.services.ServiceAdapter
getAdapterState, getDestination, handlesSubscriptions, manage, setAdapterState
 
Methods inherited from class flex.management.ManageableComponent
getControl, getId, getParent, 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

LOG_CATEGORY

public String LOG_CATEGORY
Log category for JavaAdapter.

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

initialize

public void initialize(String id,
                       ConfigMap properties)
Initializes the JavaAdapter with the properties.

Specified by:
initialize in interface FlexConfigurable
Overrides:
initialize in class ManageableComponent
Parameters:
properties - Properties for the JavaAdapter.
id - Id of the ManageableComponent.

start

public void start()
Starts the adapter.

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

stop

public void stop()
Stops the adapter.

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

getCountMethods

public List getCountMethods()
Returns the list of count methods which are of QueryMethod types.

Returns:
The list of count methods.

addCountMethod

public void addCountMethod(String name)
Adds a count method.

Parameters:
name - Name of the count method.

addCountMethod

public void addCountMethod(String name,
                           String params)
Adds a count method.

Parameters:
name - Name of the count method.
params - Comma delimited parameter type list.

setDestination

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

Overrides:
setDestination in class ServiceAdapter
Parameters:
destination -

getFillMethods

public List getFillMethods()
Returns the list of fill methods.

Returns:
The list of fill methods.

addFillMethod

public void addFillMethod(String name)
Adds a fill method.

Parameters:
name - Name of the fill method.

addFillMethod

public void addFillMethod(String name,
                          String params)
Adds a fill method.

Parameters:
name - Name of the fill method.
params - Comma delimited parameter type list.

addFillMethod

public void addFillMethod(String name,
                          String params,
                          boolean autoRefresh,
                          boolean ordered,
                          String fillContainsName)
Adds a fill method .

Parameters:
name - Name of the fill method.
params - Comma delimited parameter type list.
autoRefresh - If it is auto refreshed or not.
ordered - If it is ordered or not.
fillContainsName - Fill contains method.

getGetMethod

public JavaAdapter.GetMethod getGetMethod()
Returns the get method.

Returns:
The get method.

setGetMethod

public void setGetMethod(String name)
Sets the get method.

Parameters:
name - Name of the get method.

getSecurityConstraintManager

public SecurityConstraintManager getSecurityConstraintManager()
Gets the SecurityConstraintManager of the JavaAdapter.

Returns:
The SecurityConstraintManager of the JavaAdapter.

setSecurityConstraintManager

public void setSecurityConstraintManager(SecurityConstraintManager constraintManager)
Sets the SecurityConstraintManager of the JavaAdapter.

Parameters:
constraintManager - The SecurityConstraintManager of the JavaAdapter.

getSyncMethod

public Method getSyncMethod()
Returns the sync method.

Returns:
The sync method.

setSyncMethod

public void setSyncMethod(String name)
Sets the sync method.

Parameters:
name - Name of the sync method.

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

fillNeedsAutoRefresh

public boolean fillNeedsAutoRefresh(Object args)
This method is called directly from the data service (not using the messaging abstraction. If it returns false, the client update fill messages are used to update the sequence directly.


allowSubscribe

public boolean allowSubscribe(Subtopic subtopic)
Need a hook so that the customer can provide messaging security. For now, if the assembler class implements the messaging security interface, call these methods on that.

Specified by:
allowSubscribe in interface MessagingSecurity
Parameters:
subtopic - The subtopic the client is attempting to subscribe to.
Returns:
true to allow the subscription, false to prevent it.

allowSend

public boolean allowSend(Subtopic subtopic)
Description copied from interface: MessagingSecurity
This method is invoked before a client message is sent to a subtopic, so that custom application logic can determine whether the client should be allowed to send to the specified subtopic. You can access the current user via FlexContext.getUserPrincipal().

Specified by:
allowSend in interface MessagingSecurity
Parameters:
subtopic - The subtopic the client is attempting to send a message to.
Returns:
true to allow the message to be sent, false to prevent it.


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/data/adapters/JavaAdapter.html