2008. 9. 8. 18:03

[BlazeDS] destination 설정 / Configuring a destination

reference : http://livedocs.adobe.com/blazeds/1/blazeds_devguide/rpc_remoteobject_3.html#1073403

RPC services >Using the Remoting Service > Configuring a destination

remoting-config.xml 파일에서 Remoting Service destination 의 RemoteObject destination 을 설정할 수 있습니다. 아래의 예제는 remoting-config.xml 파일의 Remoting Service 를 위한 기본적인 서버 설정을 보여주고 있습니다:

<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>

<service> 태그의 class 속성은 RemotingService 클래스 입니다. RemoteObject 컴포넌트는 RemotingService destination 에 연결합니다.

adapte 는 Java 클래스와 상호작용하는 서버 코드 입니다. JavaAdapter 를 기본 adapter 로 설정했기 때문에, destination 이 다른 adapter 를 명시하지 않는 한 모든 destination 은 이 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.