Depending on the optimizations made by the implementation of {@link #deploy}, the resulting URL may or may not be compatible with standard {@link com.google.gwt.http.client.RequestBuilder} / XMLHttpRequest securitysemantics. If the resource is intended to be used with XHR, the xhrCompatible
paramater should be set to true
when invoking {@link #deploy}.
This interface can be injected using the {@link Context} annotation.
The resource context can be utilized when instances of managed resource classes are to be returned by sub-resource locator methods. Such instances will be injected and managed within the declared scope just like instances of root resource classes.
The resource context can be utilized when matching of URIs are required, for example when validating URIs sent in a request entity. Note that application functionality may be affected as the matching process will result in the construction or sharing of previously constructed resource classes that are in scope of the HTTP request, and the invocation of matching sub-resource locator methods. No resource methods wll be invoked. @author Martin Grotzke @author Paul.Sandoz@Sun.Com
Once the control has been associated with a ResourceContext provider, the provider will deliver events to the Control Implementation instance according to the following basic contract:
The following code fragment shows how to receive resource events from within a Control implementation:
import org.apache.beehive.controls.api.events.EventHandler; ... @EventHandler(field="resourceContext", eventSet=ResourceContext.ResourceEvents.class, eventName="onAcquire") public void onAcquire() { // code to obtain connections/sessions/... } @EventHandler(field="resourceContext", eventSet=ResourceContext.ResourceEvents.class, eventName="onRelease") public void onRelease() { // code to release connections/sessions/... }
The onAcquire resource event is guaranteed to be delivered once before any operation declared on a public or extension interface associated with the control. This event will be delivered once, and only once, within a particular resource scope associated with the ResourceContext. If a control needs to utilize its resources in another context (such as in response to a PropertyChange notification), the ResourceContext also provides support for manually acquiring and releasing resources. @see org.apache.beehive.controls.api.context.ResourceContext.ResourceEvents @see org.apache.beehive.controls.api.context.Context @see org.apache.beehive.controls.api.events.EventHandler
ResourceContext
wraps around a {@link SOAPMessageContext SOAPMessageContext} and provides conveniencefunctions for obtaining {@link ResourceKey ResourceKey}, {@link ResourceHome ResourceHome}, and resource objects associated with the given SOAP message (referenced in SOAPMessageContext
).
Java class for ResourceContext complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="ResourceContext"> <complexContent> <extension base="{urn:oasis:names:tc:wsrp:v2:types}MimeResponse"> <sequence> </sequence> </extension> </complexContent> </complexType>
This context class is currently designed to be an immutable object. Instances of this context object are to be created by the plugin container only.
@param < T> the parent resource component type for this component. This means you can nest a hierarchy of resourcecomponents that mimic the resource type hierarchy as defined in a plugin deployment descriptor. @author John Mazzitelli
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|