Class ClientGroupManager

    • Field Detail

      • baseMsg

        public final java.lang.String baseMsg
      • sentMemberShipLabel

        public static boolean sentMemberShipLabel
      • receivedIORUpdate

        public static boolean receivedIORUpdate
      • orb

        private ORB orb
      • codec

        private Codec codec
      • initialized

        private boolean initialized
      • lastIOR

        private IOR lastIOR
      • lastIORLock

        private final java.lang.Object lastIORLock
      • map

        private java.util.Map map
    • Constructor Detail

      • ClientGroupManager

        public ClientGroupManager()
    • Method Detail

      • reportException

        @InfoMethod
        private void reportException​(java.lang.Exception exc)
      • notFound

        @InfoMethod
        private void notFound​(java.lang.String name)
      • initialize

        private void initialize()
      • nonSSLSocketInfo

        @InfoMethod
        private void nonSSLSocketInfo()
      • returningPreviousSocketInfo

        @InfoMethod
        private void returningPreviousSocketInfo​(java.util.List lst)
      • getSocketInfo

        public java.util.List getSocketInfo​(IOR ior,
                                            java.util.List previous)
        Description copied from interface: IORToSocketInfo
        Used to extract socket address information from an IOR.
        Specified by:
        getSocketInfo in interface IORToSocketInfo
        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

        private SocketInfo createSocketInfo​(java.lang.String msg,
                                            java.lang.String type,
                                            java.lang.String host,
                                            int port)
      • hasNextInfo

        @InfoMethod
        private void hasNextInfo​(int previousIndex,
                                 int contactInfoSize)
      • hasNext

        public boolean hasNext​(ContactInfo primary,
                               ContactInfo previous,
                               java.util.List contactInfos)
        Specified by:
        hasNext in interface IIOPPrimaryToContactInfo
        Parameters:
        primary - the key.
        previous - if null return true. Otherwise, find previous in contactInfos and if another ContactInfo follows 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()
      • primaryMappedTo

        @InfoMethod
        private void primaryMappedTo​(java.lang.Object obj)
      • cannotFindMappedEntry

        @InfoMethod
        private void cannotFindMappedEntry()
      • iiopFailoverTo

        @InfoMethod
        private void iiopFailoverTo​(java.lang.Object obj)
      • mappedResult

        @InfoMethod
        private void mappedResult​(java.lang.Object obj)
      • mappedResultWithUpdate

        @InfoMethod
        private void mappedResultWithUpdate​(java.lang.Object obj,
                                            int prevIndex,
                                            int size)
      • next

        public ContactInfo next​(ContactInfo primary,
                                ContactInfo previous,
                                java.util.List contactInfos)
        Specified by:
        next in interface IIOPPrimaryToContactInfo
        Parameters:
        primary - the key.
        previous - if null then map primary to failover. If failover is empty then map primary to first ContactInfo in 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 the ContactInfo following previous to primary and return that ContactInfo.
        contactInfos - the list of replicas associated with the primary.
        Returns:
        the next ContactInfo
      • getKey

        private java.lang.Object getKey​(ContactInfo contactInfo)
      • getInitialClusterInstanceInfo

        public java.util.List<ClusterInstanceInfo> getInitialClusterInstanceInfo​(ORB orb,
                                                                                 java.util.List<java.lang.String> endpoints)
      • addObserver

        public boolean addObserver​(GroupInfoServiceObserver x)
        Description copied from interface: GroupInfoService
        Adds an observer that will receive a membershipChange invocation whenever the cluster membership changes. The membershipChange invocation tells the observer to call getClusterInstanceInfo to get info.
        Specified by:
        addObserver in interface GroupInfoService
        Parameters:
        x - observer to add
        Returns:
        true if the given observer is added. False otherwise.
      • notifyObservers

        public void notifyObservers()
        Description copied from interface: GroupInfoService
        Causes the membershipChange method to be called on each registered observer.
        Specified by:
        notifyObservers in interface GroupInfoService
      • getClusterInstanceInfo

        public java.util.List<ClusterInstanceInfo> getClusterInstanceInfo​(java.lang.String[] adapterName)
        Description copied from interface: GroupInfoService
        This is a separate call (rather than info being passed in membershipChange) so we can identifier the adapter. The adapter identification is used in testing.
        Specified by:
        getClusterInstanceInfo in interface GroupInfoService
        Parameters:
        adapterName - name of cluster
        Returns:
        information about instances in the cluster
      • getClusterInstanceInfo

        public java.util.List<ClusterInstanceInfo> getClusterInstanceInfo​(java.lang.String[] adapterName,
                                                                          java.util.List<java.lang.String> endpoints)
        Description copied from interface: GroupInfoService
        This is a separate call (rather than info being passed in membershipChange) so we can identifier the adapter. The adapter identification is used in testing.
        Specified by:
        getClusterInstanceInfo in interface GroupInfoService
        Parameters:
        adapterName - adapter to use
        endpoints - endpoints of cluster
        Returns:
        info on cluster
      • shouldAddAddressesToNonReferenceFactory

        public boolean shouldAddAddressesToNonReferenceFactory​(java.lang.String[] x)
        Description copied from interface: GroupInfoService
        This method only used during testing.
        Specified by:
        shouldAddAddressesToNonReferenceFactory in interface GroupInfoService
        Parameters:
        x - name to add
        Returns:
        if addresses should be added
      • shouldAddMembershipLabel

        public boolean shouldAddMembershipLabel​(java.lang.String[] adapterName)
        Description copied from interface: GroupInfoService
        This method only used during testing.
        Specified by:
        shouldAddMembershipLabel in interface GroupInfoService
        Parameters:
        adapterName - name to add
        Returns:
        if label should be added
      • name

        public java.lang.String name()
        Description copied from interface: InterceptorOperations
        Returns the name of the interceptor.

        Each Interceptor may have a name that may be used administratively to order the lists of Interceptors. Only one Interceptor of a given name can be registered with the ORB for each Interceptor type. An Interceptor may be anonymous, i.e., have an empty string as the name attribute. Any number of anonymous Interceptors may be registered with the ORB.

        Specified by:
        name in interface InterceptorOperations
        Returns:
        the name of the interceptor.
      • destroy

        public void destroy()
        Description copied from interface: InterceptorOperations
        Provides an opportunity to destroy this interceptor. The destroy method is called during ORB.destroy. When an application calls ORB.destroy, the ORB:
        1. waits for all requests in progress to complete
        2. calls the Interceptor.destroy operation for each interceptor
        3. completes destruction of the ORB
        Method invocations from within Interceptor.destroy on 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:
        destroy in interface InterceptorOperations
      • sendRequestMembershipLabel

        @InfoMethod
        private void sendRequestMembershipLabel​(java.lang.String label)
      • sendRequestNoMembershipLabel

        @InfoMethod
        private void sendRequestNoMembershipLabel()
      • send_request

        public void send_request​(ClientRequestInfo ri)
        Description copied from interface: ClientRequestInterceptorOperations
        Allows 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_request operations are called. Those Interceptors on the Flow Stack are popped and their receive_exception interception points are called. This interception point may also throw a ForwardRequest exception. If an Interceptor throws this exception, no other Interceptors' send_request operations are called. Those Interceptors on the Flow Stack are popped and their receive_other interception points are called.

        Compliant Interceptors shall properly follow completion_status semantics if they throw a system exception from this interception point. The completion_status shall be COMPLETED_NO.

        Specified by:
        send_request in interface ClientRequestInterceptorOperations
        Parameters:
        ri - Information about the current request being intercepted.
      • send_poll

        public void send_poll​(ClientRequestInfo ri)
        Description copied from interface: ClientRequestInterceptorOperations
        Allows 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_poll interception point and the response is returned through the receive_reply or receive_exception interception points. If the response is not available before the poll time-out expires, the system exception TIMEOUT is thrown and receive_exception is called with this exception.

        This interception point may throw a system exception. If it does, no other Interceptors' send_poll operations are called. Those Interceptors on the Flow Stack are popped and their receive_exception interception points are called.

        Compliant Interceptors shall properly follow completion_status semantics if they throw a system exception from this interception point. The completion_status shall be COMPLETED_NO.

        Specified by:
        send_poll in interface ClientRequestInterceptorOperations
        Parameters:
        ri - Information about the current request being intercepted.
      • receive_reply

        public void receive_reply​(ClientRequestInfo ri)
        Description copied from interface: ClientRequestInterceptorOperations
        Allows 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_reply operations are called. The remaining Interceptors in the Flow Stack shall have their receive_exception interception point called.

        Compliant Interceptors shall properly follow completion_status semantics if they throw a system exception from this interception point. The completion_status shall be COMPLETED_YES.

        Specified by:
        receive_reply in interface ClientRequestInterceptorOperations
        Parameters:
        ri - Information about the current request being intercepted.
      • receive_exception

        public void receive_exception​(ClientRequestInfo ri)
        Description copied from interface: ClientRequestInterceptorOperations
        Indicates 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 ForwardRequest exception. If an Interceptor throws this exception, no other Interceptors' receive_exception operations are called. The remaining Interceptors in the Flow Stack are popped and have their receive_other interception point called.

        If the completion_status of the exception is not COMPLETED_NO, then it is inappropriate for this interception point to throw a ForwardRequest exception. The request s at-most-once semantics would be lost.

        Compliant Interceptors shall properly follow completion_status semantics if they throw a system exception from this interception point. If the original exception is a system exception, the completion_status of the new exception shall be the same as on the original. If the original exception is a user exception, then the completion_status of the new exception shall be COMPLETED_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, the PortableInterceptor.Current for both the original request and the retrying request is the same.

        Specified by:
        receive_exception in interface ClientRequestInterceptorOperations
        Parameters:
        ri - Information about the current request being intercepted.
      • receive_other

        public void receive_other​(ClientRequestInfo ri)
        Description copied from interface: ClientRequestInterceptorOperations
        Allows 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 a LOCATION_FORWARD status 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.Current for 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_other operations are called. The remaining Interceptors in the Flow Stack are popped and have their receive_exception interception point called.

        This interception point may also throw a ForwardRequest exception. If an Interceptor throws this exception, successive Interceptors' receive_other operations are called with the new information provided by the ForwardRequest exception.

        Compliant Interceptors shall properly follow completion_status semantics if they throw a system exception from this interception point. The completion_status shall be COMPLETED_NO. If the target invocation had completed, this interception point would not be called.

        Specified by:
        receive_other in interface ClientRequestInterceptorOperations
        Parameters:
        ri - Information about the current request being intercepted.
      • operation

        @InfoMethod
        private void operation​(java.lang.String op)
      • noIORUpdate

        @InfoMethod
        private void noIORUpdate()
      • receivedIORUpdateInfo

        @InfoMethod
        private void receivedIORUpdateInfo()
      • receive_star

        private void receive_star​(java.lang.String point,
                                  ClientRequestInfo ri)
      • extractIOR

        protected IOR extractIOR​(byte[] data)
      • pre_init

        public void pre_init​(ORBInitInfo info)
        Description copied from interface: ORBInitializerOperations
        Called during ORB initialization. If it is expected that initial services registered by an interceptor will be used by other interceptors, then those initial services shall be registered at this point via calls to ORBInitInfo.register_initial_reference.
        Specified by:
        pre_init in interface ORBInitializerOperations
        Parameters:
        info - provides initialization attributes and operations by which Interceptors can be registered.
      • post_init

        public void post_init​(ORBInitInfo info)
        Description copied from interface: ORBInitializerOperations
        Called 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_init operations is not the final task of ORB initialization. The final task, following the post_init calls, is attaching the lists of registered interceptors to the ORB. Therefore, the ORB does not contain the interceptors during calls to post_init. If an ORB-mediated call is made from within post_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_init in interface ORBInitializerOperations
        Parameters:
        info - provides initialization attributes and operations by which Interceptors can be registered.