com.ibm.wbi
Interface MegContext


public interface MegContext

A MegContext defines the context inwhich this Meg request is running under. Portions of this context may not be defined for different context implementations and Meg writers need to be aware that methods are allowed to return null for non-applicable methods.


Method Summary
 java.lang.Object getMegResource(java.lang.String key)
          Obtain a Meg resource by a Meg resource identification key.
 java.util.Enumeration getRequestServiceElements()
          Obtain a list of the identities available for the getRequestService(Integer) method.
 com.ibm.wbi.Service getService()
          Obtain a Service providing an api for making requests of the same type as this Request being serviced.
 com.ibm.wbi.Service getService(java.lang.Integer identity)
          Obtain a Service providing an api for making requests to the specified request identity.
 java.util.Enumeration megResourceKeys()
          Obtain a list of available Meg resource identification keys.
 void removeMegResource(java.lang.String key)
          Remove the MegResource with the given key.
 void setMegResource(java.lang.String key, java.lang.Object resource)
          Set a MegResource that can be retreived by getmegResource.
 

Method Detail

getMegResource

public java.lang.Object getMegResource(java.lang.String key)
Obtain a Meg resource by a Meg resource identification key.
Parameters:
key - The Meg resource key.
Returns:
The Meg resource.

setMegResource

public void setMegResource(java.lang.String key,
                           java.lang.Object resource)
Set a MegResource that can be retreived by getmegResource. An subsequent Megs in the Meg chain can now obtain a reference to this resource by the specified key.
Parameters:
key - The Meg resource key.
resource - The Meg resource.

removeMegResource

public void removeMegResource(java.lang.String key)
Remove the MegResource with the given key.
Parameters:
key - The Meg resource key.

megResourceKeys

public java.util.Enumeration megResourceKeys()
Obtain a list of available Meg resource identification keys.
Returns:
An enumeration of keys.

getService

public com.ibm.wbi.Service getService()
                               throws RequestRejectedException
Obtain a Service providing an api for making requests of the same type as this Request being serviced. For example if this is an Http 1.0 request, the RequestStub allows the spawning of new Http 1.0 Requests inside the Proxy and retrieving the response. The request is serviced just as any request in the Proxy by flowing through all satsifying Megs, etc.
Returns:
The Service api for making requests.
Throws:
RequestRejectedException - If this request type does not support making internal requests.

getService

public com.ibm.wbi.Service getService(java.lang.Integer identity)
                               throws RequestRejectedException
Obtain a Service providing an api for making requests to the specified request identity. For example if this is an Http 1.0 request, the RequestStub may allow the spawning of new Pop3 Requests inside the Proxy and retrieving the response. The request is serviced just as any request in the Proxy by flowing through all satsifying Megs, etc.
Parameters:
identity - The identity of the request type.
Returns:
The Service api for making requests.
Throws:
RequestRejectedException - If this request type does not support making internal requests.

getRequestServiceElements

public java.util.Enumeration getRequestServiceElements()
Obtain a list of the identities available for the getRequestService(Integer) method.
Returns:
The enumeration of identities.