Class ClientGroupManager
- All Implemented Interfaces:
GroupInfoService, ORBConfigurator, IIOPPrimaryToContactInfo, IORToSocketInfo, Serializable, Object, IDLEntity, ClientRequestInterceptor, ClientRequestInterceptorOperations, Interceptor, InterceptorOperations, ORBInitializer, ORBInitializerOperations
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Stringprivate Codecprivate CSIv2SSLTaggedComponentHandlerprivate ClientGroupManager.GISprivate booleanprivate IORprivate final Objectprivate Map/////////////////////////////////////////////////private ORBstatic booleanstatic booleanprivate static final longprivate static final ORBUtilSystemException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an observer that will receive amembershipChangeinvocation whenever the cluster membership changes.private voidvoidconfigure(DataCollector collector, ORB orb) /////////////////////////////////////////////////private SocketInfocreateSocketInfo(String msg, String type, String host, int port) voiddestroy()Provides an opportunity to destroy this interceptor.protected IORextractIOR(byte[] data) getClusterInstanceInfo(String[] adapterName) This is a separate call (rather than info being passed inmembershipChange) so we can identifier the adapter.getClusterInstanceInfo(String[] adapterName, List<String> endpoints) This is a separate call (rather than info being passed inmembershipChange) so we can identifier the adapter.getInitialClusterInstanceInfo(ORB orb, List<String> endpoints) /////////////////////////////////////////////////private ObjectgetKey(ContactInfo contactInfo) getSocketInfo(IOR ior, List previous) Used to extract socket address information from an IOR.booleanhasNext(ContactInfo primary, ContactInfo previous, List contactInfos) private voidhasNextInfo(int previousIndex, int contactInfoSize) private voidiiopFailoverTo(Object obj) private voidprivate voidprivate voidmappedResult(Object obj) private voidmappedResultWithUpdate(Object obj, int prevIndex, int size) name()/////////////////////////////////////////////////next(ContactInfo primary, ContactInfo previous, List contactInfos) private voidprivate void/////////////////////////////////////////////////private voidvoidCauses themembershipChangemethod to be called on each registered observer.private voidvoidpost_init(ORBInitInfo info) Called during ORB initialization.voidpre_init(ORBInitInfo info) /////////////////////////////////////////////////private voidprimaryMappedTo(Object obj) voidIndicates to the interceptor that an exception occurred.voidAllows an Interceptor to query the information available when a request results in something other than a normal reply or an exception.voidAllows an Interceptor to query the information on a reply after it is returned from the server and before control is returned to the client.private voidreceive_star(String point, ClientRequestInfo ri) private voidprivate voidreportException(Exception exc) protected voidreportLocatedIOR(ClientRequestInfo ri, IOR ior) voidreset(ContactInfo primary) private voidvoidAllows an Interceptor to query information during a Time-Independent Invocation (TII) polling get reply sequence.voidAllows an Interceptor to query request information and modify the service context before the request is sent to the server.private voidsendRequestMembershipLabel(String label) /////////////////////////////////////////////////private voidbooleanThis method only used during testing.booleanshouldAddMembershipLabel(String[] adapterName) This method only used during testing.Methods inherited from class LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connectionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
Field Details
-
wrapper
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
baseMsg
-
sentMemberShipLabel
public static boolean sentMemberShipLabel -
receivedIORUpdate
public static boolean receivedIORUpdate -
orb
-
codec
-
initialized
private boolean initialized -
lastIOR
-
lastIORLock
-
csiv2SSLTaggedComponentHandler
-
gis
-
map
/////////////////////////////////////////////////
-
-
Constructor Details
-
ClientGroupManager
public ClientGroupManager()
-
-
Method Details
-
reportException
-
notFound
-
initialize
private void initialize() -
nonSSLSocketInfo
@InfoMethod private void nonSSLSocketInfo()///////////////////////////////////////////////// -
returningPreviousSocketInfo
-
getSocketInfo
Description copied from interface:IORToSocketInfoUsed to extract socket address information from an IOR.- Specified by:
getSocketInfoin interfaceIORToSocketInfo- Parameters:
ior- The ior from which the socket info is extracted.previous- The previous list, which may be reused if not null.- Returns:
- a list of SocketInfo.
-
createSocketInfo
-
reset
- Specified by:
resetin interfaceIIOPPrimaryToContactInfo- Parameters:
primary- - clear any state relating to primary.
-
hasNextInfo
@InfoMethod private void hasNextInfo(int previousIndex, int contactInfoSize) -
hasNext
- Specified by:
hasNextin interfaceIIOPPrimaryToContactInfo- Parameters:
primary- the key.previous- if null return true. Otherwise, find previous incontactInfosand if anotherContactInfofollows it in the list then return true. Otherwise false.contactInfos- the list of replicas associated with the primary.- Returns:
- if there is another
-
initializeMap
@InfoMethod private void initializeMap() -
-
cannotFindMappedEntry
@InfoMethod private void cannotFindMappedEntry() -
iiopFailoverTo
-
mappedResult
-
mappedResultWithUpdate
-
next
- Specified by:
nextin interfaceIIOPPrimaryToContactInfo- Parameters:
primary- the key.previous- if null then map primary to failover. If failover is empty then map primary to firstContactInfoin contactInfos and mapped entry. If failover is non-empty then return failover. If previous is non-null that indicates that the previous failed. Therefore, find previous in contactInfos. Map theContactInfofollowing previous to primary and return thatContactInfo.contactInfos- the list of replicas associated with the primary.- Returns:
- the next ContactInfo
-
getKey
-
getInitialClusterInstanceInfo
///////////////////////////////////////////////// -
addObserver
Description copied from interface:GroupInfoServiceAdds an observer that will receive amembershipChangeinvocation whenever the cluster membership changes. ThemembershipChangeinvocation tells the observer to callgetClusterInstanceInfoto get info.- Specified by:
addObserverin interfaceGroupInfoService- Parameters:
x- observer to add- Returns:
- true if the given observer is added. False otherwise.
-
notifyObservers
public void notifyObservers()Description copied from interface:GroupInfoServiceCauses themembershipChangemethod to be called on each registered observer.- Specified by:
notifyObserversin interfaceGroupInfoService
-
getClusterInstanceInfo
Description copied from interface:GroupInfoServiceThis is a separate call (rather than info being passed inmembershipChange) so we can identifier the adapter. The adapter identification is used in testing.- Specified by:
getClusterInstanceInfoin interfaceGroupInfoService- Parameters:
adapterName- name of cluster- Returns:
- information about instances in the cluster
-
getClusterInstanceInfo
public List<ClusterInstanceInfo> getClusterInstanceInfo(String[] adapterName, List<String> endpoints) Description copied from interface:GroupInfoServiceThis is a separate call (rather than info being passed inmembershipChange) so we can identifier the adapter. The adapter identification is used in testing.- Specified by:
getClusterInstanceInfoin interfaceGroupInfoService- Parameters:
adapterName- adapter to useendpoints- endpoints of cluster- Returns:
- info on cluster
-
shouldAddAddressesToNonReferenceFactory
Description copied from interface:GroupInfoServiceThis method only used during testing.- Specified by:
shouldAddAddressesToNonReferenceFactoryin interfaceGroupInfoService- Parameters:
x- name to add- Returns:
- if addresses should be added
-
shouldAddMembershipLabel
Description copied from interface:GroupInfoServiceThis method only used during testing.- Specified by:
shouldAddMembershipLabelin interfaceGroupInfoService- Parameters:
adapterName- name to add- Returns:
- if label should be added
-
name
/////////////////////////////////////////////////- Specified by:
namein interfaceInterceptorOperations- Returns:
- the name of the interceptor.
-
destroy
public void destroy()Description copied from interface:InterceptorOperationsProvides an opportunity to destroy this interceptor. The destroy method is called duringORB.destroy. When an application callsORB.destroy, the ORB:- waits for all requests in progress to complete
- calls the
Interceptor.destroyoperation for each interceptor - completes destruction of the ORB
Interceptor.destroyon object references for objects implemented on the ORB being destroyed result in undefined behavior. However, method invocations on objects implemented on an ORB other than the one being destroyed are permitted. (This means that the ORB being destroyed is still capable of acting as a client, but not as a server.)- Specified by:
destroyin interfaceInterceptorOperations
-
sendRequestMembershipLabel
///////////////////////////////////////////////// -
sendRequestNoMembershipLabel
@InfoMethod private void sendRequestNoMembershipLabel() -
send_request
Description copied from interface:ClientRequestInterceptorOperationsAllows an Interceptor to query request information and modify the service context before the request is sent to the server.This interception point may throw a system exception. If it does, no other Interceptors'
send_requestoperations are called. Those Interceptors on the Flow Stack are popped and theirreceive_exceptioninterception points are called. This interception point may also throw aForwardRequestexception. If an Interceptor throws this exception, no other Interceptors'send_requestoperations are called. Those Interceptors on the Flow Stack are popped and theirreceive_otherinterception points are called.Compliant Interceptors shall properly follow completion_status semantics if they throw a system exception from this interception point. The
completion_statusshall beCOMPLETED_NO.- Specified by:
send_requestin interfaceClientRequestInterceptorOperations- Parameters:
ri- Information about the current request being intercepted.
-
send_poll
Description copied from interface:ClientRequestInterceptorOperationsAllows an Interceptor to query information during a Time-Independent Invocation (TII) polling get reply sequence.With TII, an application may poll for a response to a request sent previously by the polling client or some other client. This poll is reported to Interceptors through the
send_pollinterception point and the response is returned through thereceive_replyorreceive_exceptioninterception points. If the response is not available before the poll time-out expires, the system exceptionTIMEOUTis thrown andreceive_exceptionis called with this exception.This interception point may throw a system exception. If it does, no other Interceptors'
send_polloperations are called. Those Interceptors on the Flow Stack are popped and theirreceive_exceptioninterception points are called.Compliant Interceptors shall properly follow
completion_statussemantics if they throw a system exception from this interception point. The completion_status shall beCOMPLETED_NO.- Specified by:
send_pollin interfaceClientRequestInterceptorOperations- Parameters:
ri- Information about the current request being intercepted.
-
receive_reply
Description copied from interface:ClientRequestInterceptorOperationsAllows an Interceptor to query the information on a reply after it is returned from the server and before control is returned to the client.This interception point may throw a system exception. If it does, no other Interceptors'
receive_replyoperations are called. The remaining Interceptors in the Flow Stack shall have theirreceive_exceptioninterception point called.Compliant Interceptors shall properly follow
completion_statussemantics if they throw a system exception from this interception point. Thecompletion_statusshall beCOMPLETED_YES.- Specified by:
receive_replyin interfaceClientRequestInterceptorOperations- Parameters:
ri- Information about the current request being intercepted.
-
receive_exception
Description copied from interface:ClientRequestInterceptorOperationsIndicates to the interceptor that an exception occurred. Allows an Interceptor to query the exception's information before it is thrown to the client.This interception point may throw a system exception. This has the effect of changing the exception which successive Interceptors popped from the Flow Stack receive on their calls to
receive_exception. The exception thrown to the client will be the last exception thrown by an Interceptor, or the original exception if no Interceptor changes the exception.This interception point may also throw a
ForwardRequestexception. If an Interceptor throws this exception, no other Interceptors'receive_exceptionoperations are called. The remaining Interceptors in the Flow Stack are popped and have theirreceive_otherinterception point called.If the
completion_statusof the exception is notCOMPLETED_NO, then it is inappropriate for this interception point to throw aForwardRequestexception. The request s at-most-once semantics would be lost.Compliant Interceptors shall properly follow
completion_statussemantics if they throw a system exception from this interception point. If the original exception is a system exception, thecompletion_statusof the new exception shall be the same as on the original. If the original exception is a user exception, then thecompletion_statusof the new exception shall beCOMPLETED_YES.Under some conditions, depending on what policies are in effect, an exception (such as
COMM_FAILURE) may result in a retry of the request. While this retry is a new request with respect to Interceptors, there is one point of correlation between the original request and the retry: because control has not returned to the client, thePortableInterceptor.Currentfor both the original request and the retrying request is the same.- Specified by:
receive_exceptionin interfaceClientRequestInterceptorOperations- Parameters:
ri- Information about the current request being intercepted.
-
receive_other
Description copied from interface:ClientRequestInterceptorOperationsAllows an Interceptor to query the information available when a request results in something other than a normal reply or an exception. For example, a request could result in a retry (e.g., a GIOP Reply with aLOCATION_FORWARDstatus was received); or on asynchronous calls, the reply does not immediately follow the request, but control shall return to the client and an ending interception point shall be called.For retries, depending on the policies in effect, a new request may or may not follow when a retry has been indicated. If a new request does follow, while this request is a new request, with respect to Interceptors, there is one point of correlation between the original request and the retry: because control has not returned to the client, the request scoped
PortableInterceptor.Currentfor both the original request and the retrying request is the same.This interception point may throw a system exception. If it does, no other Interceptors'
receive_otheroperations are called. The remaining Interceptors in the Flow Stack are popped and have theirreceive_exceptioninterception point called.This interception point may also throw a
ForwardRequestexception. If an Interceptor throws this exception, successive Interceptors'receive_otheroperations are called with the new information provided by theForwardRequestexception.Compliant Interceptors shall properly follow
completion_statussemantics if they throw a system exception from this interception point. Thecompletion_statusshall beCOMPLETED_NO. If the target invocation had completed, this interception point would not be called.- Specified by:
receive_otherin interfaceClientRequestInterceptorOperations- Parameters:
ri- Information about the current request being intercepted.
-
operation
-
noIORUpdate
@InfoMethod private void noIORUpdate() -
receivedIORUpdateInfo
@InfoMethod private void receivedIORUpdateInfo() -
receive_star
-
reportLocatedIOR
-
extractIOR
-
pre_init
/////////////////////////////////////////////////- Specified by:
pre_initin interfaceORBInitializerOperations- Parameters:
info- provides initialization attributes and operations by which Interceptors can be registered.
-
post_init
Description copied from interface:ORBInitializerOperationsCalled during ORB initialization. If a service must resolve initial references as part of its initialization, it can assume that all initial references will be available at this point.Calling the
post_initoperations is not the final task of ORB initialization. The final task, following thepost_initcalls, is attaching the lists of registered interceptors to the ORB. Therefore, the ORB does not contain the interceptors during calls topost_init. If an ORB-mediated call is made from withinpost_init, no request interceptors will be invoked on that call. Likewise, if an operation is performed which causes an IOR to be created, no IOR interceptors will be invoked.- Specified by:
post_initin interfaceORBInitializerOperations- Parameters:
info- provides initialization attributes and operations by which Interceptors can be registered.
-
configure
/////////////////////////////////////////////////- Specified by:
configurein interfaceORBConfigurator
-