Skip navigation links

Oracle© Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.7.0)
E10684-08


oracle.adf.view.rich.model
Class RemoteRegionModel

java.lang.Object
  extended by oracle.adf.view.rich.model.RegionModel
      extended by oracle.adf.view.rich.model.RemoteRegionModel

All Implemented Interfaces:
RemoteRegionListener

public abstract class RemoteRegionModel
extends RegionModel
implements RemoteRegionListener

Model for a remote Region Component. This model provides extensions that are needed to allow the Region to make a connection to another server. This version of the RegionModel also implements the contract for the RemoteRegionListener. The contract for this listener is the same as for the standard RemoteRegionListener except that the models beforeRequest is guarenteed to be executed before any other listener and it's endRequest is guarenteed to be executed after any other listener and no registration of the listener is necessary.

See Also:
RemoteRegionListener

Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.adf.view.rich.model.RegionModel
RegionModel.RegionAction

 

Constructor Summary
RemoteRegionModel()
           

 

Method Summary
abstract  void afterRequest(RemoteApplicationResponse resp, java.util.Map<java.lang.String,java.lang.Object> stateMap)
          Executed after the request to the remote region.
abstract  void beforeRequest(RemoteApplicationRequest req, java.util.Map<java.lang.String,java.lang.Object> stateMap)
          Executed before the request to the remote region.
 void clearRemoteApplicationInstance()
          Removes the stored RemoteApplicationInstance from the model.
 java.lang.String getBootstrap()
          Return bootstrap
 RemoteApplicationInstance getRemoteApplicationInstance()
          Returns the current RemoteApplicationInstance.
abstract  java.util.concurrent.ConcurrentHashMap<java.lang.String,java.io.Serializable> getRemoteAttributeMap()
          Returns a map that may be used for persisted storage.
abstract  java.net.URI getURI()
          Returns the URI for the remote application context.
 boolean isActive()
          Allows the model to prevent a remote application call from being made.
 boolean isAuthorizationRequired()
          Returns whether or not an authorization token should be provided on the first request.
 boolean isRemoteApplicationInstancePresent()
          Tells whether there is a RemoteApplicationInstance stored in this model
protected  void queueRefreshEvent()
          Queues a RegionRefreshEvent on all of the components which are represented by this RemoteRegionModel instance.
 void setRemoteApplicationInstance(RemoteApplicationInstance instance)
          Sets the current RemoteApplicationInstance.

 

Methods inherited from class oracle.adf.view.rich.model.RegionModel
getActions, getCapabilities, getRegionComponentClientIds, getViewId, markRegionDirty, processBeginRegion, processBeginRegion, processEndRegion, processEndRegion, refresh

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

RemoteRegionModel

public RemoteRegionModel()

Method Detail

beforeRequest

public abstract void beforeRequest(RemoteApplicationRequest req,
                                   java.util.Map<java.lang.String,java.lang.Object> stateMap)
Executed before the request to the remote region. This allows the listener to add tasks to it's task handler. This listener is always guarenteed to be executed while the region is in context, meaning that the processBeginRegion will have run.
Specified by:
beforeRequest in interface RemoteRegionListener
Parameters:
req - the Response from the remote server
stateMap - a of string keys and object values that provides temporary storage between the begin and the beforeRequest and afterRequest methods.
See Also:
RemoteRegionListener

afterRequest

public abstract void afterRequest(RemoteApplicationResponse resp,
                                  java.util.Map<java.lang.String,java.lang.Object> stateMap)
Executed after the request to the remote region. This allows the listener to receive input from its task handlers.
Specified by:
afterRequest in interface RemoteRegionListener
Parameters:
resp - the Response from the remote server
stateMap - a of string keys and object values that provides temporary storage between the begin and the beforeRequest and afterRequest methods.
See Also:
RemoteRegionListener

getURI

public abstract java.net.URI getURI()
Returns the URI for the remote application context. This includes the any server prefix needed for the remote application on the remote server (like ws-faces/) but DOES NOT include the location of the bootstrap.. This should be able to change from request to request.
Returns:

isAuthorizationRequired

public boolean isAuthorizationRequired()
Returns whether or not an authorization token should be provided on the first request. If this is false and authorization is needed, the server will still go though a standard challenge/response negotiation with the producer, but if this is true the authorization will still be provided on the first request to a server in order to save the additional round trip.
Returns:
a boolean containing true if authorization should be sent on the first call to the producer and false if the normal challenge/response should be used.

isActive

public boolean isActive()
Allows the model to prevent a remote application call from being made. If this is false, any requests to the producer will be skipped.
Returns:
a boolean containing false if the remote connection is not needed or true if it is.

getRemoteAttributeMap

public abstract java.util.concurrent.ConcurrentHashMap<java.lang.String,java.io.Serializable> getRemoteAttributeMap()
Returns a map that may be used for persisted storage. The remote region is stateful and this map allows the RemoteRegion to store attributes which will help allow it to persist data needed to manage the remote connection.

It is important to not that this map has two requirements. First is must be thread-safe and second is it must be serializable. As such, the ConcurrentHashMap is returned from this method rather then a more generic type.

Returns:
a ConcurrentHashMap containing the modules state

setRemoteApplicationInstance

public void setRemoteApplicationInstance(RemoteApplicationInstance instance)
Sets the current RemoteApplicationInstance. The remote region is stateful and this is one of the properties that needs to be maintained from request to request. If the RemoteApplicationInstance is null then it should be the same as unsetting the instance value such that calls to getRemoteApplicationInstance() return null. This method will change both the persisted RemoteApplicationInstance as well as the locally stored instance.
Parameters:
instance - the RemoteApplicationInstance for this region or null
Throws:
NullPointerException - if the provided application instance is null

clearRemoteApplicationInstance

public void clearRemoteApplicationInstance()
Removes the stored RemoteApplicationInstance from the model.

getRemoteApplicationInstance

public RemoteApplicationInstance getRemoteApplicationInstance()
Returns the current RemoteApplicationInstance. The first time this method is run for a particular RemoteRegionModel instance, it will pull the persisted value of the RemoteApplicationInstance from the persisted state. From there on, it will use a "cached" copy of the object to prevent the RemoteApplicationInstance from changing durring the processing of the remote region. Only setRemoteApplicationInstance(RemoteApplicationInstance) will change the locally stored copy.
Returns:
the current RemoteApplicationInstance or null if one has not been stored.

isRemoteApplicationInstancePresent

public boolean isRemoteApplicationInstancePresent()
Tells whether there is a RemoteApplicationInstance stored in this model

getBootstrap

public java.lang.String getBootstrap()
Return bootstrap
Returns:

queueRefreshEvent

protected void queueRefreshEvent()
Queues a RegionRefreshEvent on all of the components which are represented by this RemoteRegionModel instance. Please note that while queueing the RefreshEvent is expected to function properly under all circumstances, marking the region as dirty AFTER queueing the event may result in a secondary request in some circumstances. For performance reasons, IF the region needs to be marked dirty, it should be done BEFORE queuing the event.

Skip navigation links

Oracle© Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.7.0)
E10684-08


Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.