blob: c945f6d5a2145e20a5b349383ee6c63dcd85ff8c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<service id="remoting-service" class="flex.messaging.services.RemotingService">
<!-- Example remoting-config.xml -->
<!--
The set of adapters available for this service. A service uses an
adapter to handle the implementation specifc details of a
destination.
-->
<adapters>
<!--
id: A unique id for this adapter-definition. Destinations use this
id to select which adapter should be used to process requests.
class: The implementation class for the adapter. A single Remoting
Service adapter ships with Flex 2:
flex.messaging.services.remoting.adapters.JavaAdapter
default: An optional boolean attribute identifying the adapter to
use when none is specified for a destination.
-->
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
<!--
Adapters may be broken in to their own file
To collect multiple adapter-definitions in a single file, wrap them in an <adapters> tag
-->
<adapter-include file-path="my-adapter.xml"/>
<!-- This will include all *.xml files in the directory 'my-adapters'. -->
<adapter-include directory-path="my-adapters"/>
</adapters>
<!--
The set of default channels to use to transport messages to
remoting-service destinations.
-->
<default-channels>
<!--
ref: A reference to a channel-definition id. Channels are defined
in the top level configuration file.
-->
<channel ref="my-amf"/>
<channel ref="my-http"/>
</default-channels>
<!-- Optional. An example of default security constraint. If one specified,
it applies to all destinations of the service without security constraints.
Destinations can still overwrite the default security constraint by defining
their own security constraint.
<default-security-constraint ref="sample-users"/>
-->
<!-- Multiple destinations may be specified either in this file or they could be broken
into their own file.
-->
<!-- An example of a destination defined in another file -->
<destination-include file-path="my-remoting-destination-config.xml" />
<!-- An example of destinations defined in a directory of XML files
The directory is relative to the location of this file.
This will include any *.xml files contained in 'remoting-destinations' in the current config directory.
-->
<destination-include directory-path="remoting-destinations" />
<!--
A simple example.
This destination uses the default set of channels 'my-amf' and
'my-http', relies on the default adapter configured for this service,
'java-object' (an instance of JavaAdapter), will use the default factory
of the JavaAdapter - the flex.messaging.factories.JavaFactory, and
POJO instances of the class specified by the source property will be
created in the default scope, the 'request' scope.
-->
<destination id="sample">
<properties>
<!-- source is the Java class name of the destination -->
<source>my.company.SampleService</source>
</properties>
</destination>
<!--
A more complex example.
A custom factory is used to create instances of the source specified
for this destination. Instances will be shared between requests in
the same session. This destination also restricts access to
authenticated users who are in the 'sampleusers' role.
-->
<destination id="sampleByFactoryAndSecure">
<security>
<security-constraint ref="sample-users" />
</security>
<properties>
<!--
myJavaFactory is defined in the main configuration file. The
source and all other properties are used by the factory to
create the java class. Factory instance provides the java class
based on the properties provided such as scope.
-->
<factory>myJavaFactory</factory>
<source>my.company.SampleService</source>
<!-- Possible scope values are request, session or application. -->
<scope>session</scope>
</properties>
</destination>
<!--
A verbose example using child tags.
-->
<destination id="sampleVerbose">
<channels>
<channel ref="my-secure-amf" />
<channel ref="my-secure-http" />
</channels>
<adapter ref="java-object" />
<security>
<security-constraint ref="sample-users" />
</security>
<properties>
<source>my.company.SampleService</source>
<scope>session</scope>
<factory>myJavaFactory</factory>
</properties>
</destination>
<!--
The same verbose example using attributes.
-->
<destination id="sampleVerboseByAttributes"
channels="my-secure-amf,my-secure-http"
adapter="java-object"
security-constraint="sample-users">
<properties>
<source>my.company.SampleService</source>
<scope>session</scope>
<factory>myJavaFactory</factory>
</properties>
</destination>
<!--
An example using an inline security constraint.
-->
<destination id="sampleInlineConstraint">
<security>
<security-constraint>
<auth-method>Custom</auth-method>
<roles>
<role>sampleusers</role>
</roles>
</security-constraint>
</security>
<properties>
<source>my.company.SampleService</source>
</properties>
</destination>
<!--
An example of method-level configuration that only
allows invocation of the include methods that are
explicitly listed.
Attempts to invoke any method defined by the 'source'
that is not in the 'include-methods' list will fault.
Note that method-level security constraints may be
defined for 'include-methods'. If a destination-level
security constraint is defined, it will be tested first.
Following that, the method-level constraint is checked.
-->
<destination id="sampleIncludeMethods">
<security>
<security-constraint ref="sample-users" />
</security>
<properties>
<source>my.company.SampleService</source>
<include-methods>
<method name="fooMethod"/>
<method name="barMethod" security-constraint="admin-users"/>
</include-methods>
</properties>
</destination>
<!--
An example of method-level configuration that blocks
invocation of exclude methods that are explicitly listed.
Attempts to invoke any 'exclude-methods' will fault.
-->
<destination id="sampleExcludeMethods">
<properties>
<source>my.company.SampleService</source>
<exclude-methods>
<method name="somePrivateMethod"/>
</exclude-methods>
</properties>
</destination>
</service>