You configure RemoteObject destinations in the Remoting Service definition in the remoting-config.xml file. The following example shows a basic server-side configuration for a Remoting Service in the remoting-config.xml file:
<service id="remoting-service"
class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
</adapters>
<default-channels>
<channel ref="samples-amf"/>
</default-channels>
<destination id="restaurant">
<properties>
<source>samples.restaurant.RestaurantService</source>
<scope>application</scope>
</properties>
</destination>
</service>
The class attribute of the <service> tag specifies the RemotingService class. RemoteObject components connect to RemotingService destinations.
The adapter is server-side code that interacts with the Java class. Because you set the JavaAdapter as the default adapter, all destinations use it unless the destination explicitly specifies another adapter.
Use the source and scope elements of a Remoting Service destination definition to specify the Java object that the destination uses. Additionally, specify whether the destination is available in the request scope (stateless), the application scope, or the session scope. The following table describes these properties:
|
Element |
Description |
|---|---|
| source |
Fully qualified class name of the Java object (remote object). |
| scope |
Indicates whether the object is available in the request scope, the application scope, or the session scope. Use the request scope when you configure a Remoting Service destination to access stateless objects. With the request scope, the server creates an instance of the Java class on each request. Use the request scope if you are storing the object in the application or session scope causes memory problems. When you use the session scope, the server creates an instance of the Java object once on the server for the session. For example, multiple tabs in the same web browser share the same session. If you open a Flex application in one tab, any copy of that application running in another tab accesses the same Java object. When you use the application scope, the server creates an instance of the Java object once on the server for the entire application. The default value is request. |
For Remoting Service destinations, you can declare destinations that only allow invocation of methods that are explicitly included in an include list. Any attempt to invoke a method that is not in the include-methods list results in a fault. For even finer grained security, you can assign a security constraint to one or more of the methods in the include-methods list. If a destination-level security constraint is defined, it is tested first. Following that, the method-level constraints are checked. For more information, see Configuring a destination to use a security constraint.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/rpc_remoteobject_3.html