<?xml version="1.0" encoding="ISO-8859-1"?>
(UNKNOWN: oc-resource-adaptor-jar PUBLIC
"-//Open Cloud Ltd.//DTD JAIN SLEE Resource Adaptor Extension 1.1.1//EN"
"http://www.opencloud.com/dtd/oc-resource-adaptor-jar_1_1_1.dtd")
<oc-resource-adaptor-jar>
<resource-adaptor id="Example RA">
...
<limiter-endpoint-ref>
<description>Optional description of the endpoint</description>
<limiter-endpoint-ref-name>limiter/myEndpoint</limiter-endpoint-ref-name>
<limiter-endpoint-name>myEndpoint</limiter-endpoint-name>
</limiter-endpoint-ref>
...
</resource-adaptor>
</oc-resource-adaptor-jar>
Interface LimiterEndpoint
-
- All Known Subinterfaces:
RateLimiterEndpoint
public interface LimiterEndpoint
Marker interface for all types of limiter endpoint.
LimiterEndpoint
objects are the interface between the Rate Limiting system and an RA or SBB that uses the Rate Limiting system. They cannot be created directly, instead they are declared in extension deployment descriptors and the SLEE will pass suitable implementations to an RA via ConfigProperties and to an SBB via JNDI.There is no restriction on the number of endpoints used in an RA / SBB.
To use a
LimiterEndpoint
you first need to:-
Declare it in an extension deployment descriptor
-
Look it up during raConfigure / setSbbContext and store a reference to it
More information about the Rate Limiting system is available in the How-to section of the Rhino Administration and Deployment Guide.
To declare a limiter endpoint for an RA
Declare the limiter endpoint in the RA extension deployment descriptor (oc-resource-adaptor-jar_2_1.xml):
To declare a limiter endpoint for an SBB
Declare the limiter endpoint in the SBB extension deployment descriptor (oc-sbb-jar_2_1.xml):
<?xml version="1.0" encoding="ISO-8859-1"?> (UNKNOWN: oc-sbb-jar PUBLIC "-//Open Cloud Ltd.//DTD JAIN SLEE SBB Extension 1.1.1//EN" "http://www.opencloud.com/slee/oc-sbb-jar_1_1_1.dtd") <oc-sbb-jar> <sbb id="Example SBB"> ... <limiter-endpoint-ref> <description>Optional description of the endpoint</description> <limiter-endpoint-ref-name>limiter/myEndpoint</limiter-endpoint-ref-name> <limiter-endpoint-name>myEndpoint</limiter-endpoint-name> </limiter-endpoint-ref> ... </sbb> </oc-sbb-jar>
To look up a limiter endpoint for an RA
public class MyResourceAdapter implements ResourceAdaptor { private RateLimiterEndpoint myEndpoint; public void raConfigure(ConfigProperties configProperties) { ... this.myEndpoint = (RateLimiterEndpoint) configProperties.getProperty("limiter/myEndpoint").getValue(); ... } ... }
To look up a limiter endpoint for an SBB
public class MySbb implements Sbb { private RateLimiterEndpoint myEndpoint; public void setSbbContext(SbbContext ctx) { ... try { final Context env = (Context) new InitialContext().lookup("java:comp/env"); this.myEndpoint = (RateLimiterEndpoint) env.lookup("limiter/myEndpoint"); } catch (NamingException e) { getTracer().warning("Exception getting limiter endpoint 'limiter/myEndpoint'", e); } ... } ... }
- See Also:
RateLimiterEndpoint