Class ORBLazyServiceInitializer

  • All Implemented Interfaces:
    org.glassfish.hk2.api.PostConstruct, LazyServiceInitializer

    @Service
    @Named("iiop-service")
    public class ORBLazyServiceInitializer
    extends Object
    implements LazyServiceInitializer, org.glassfish.hk2.api.PostConstruct
    Author:
    Ken Saks
    • Constructor Detail

      • ORBLazyServiceInitializer

        public ORBLazyServiceInitializer()
    • Method Detail

      • postConstruct

        public void postConstruct()
        Specified by:
        postConstruct in interface org.glassfish.hk2.api.PostConstruct
      • getServiceName

        public String getServiceName()
      • initializeService

        public boolean initializeService()
        Description copied from interface: LazyServiceInitializer
        Upon accepting the first request on the port (to which this listener is bound), the listener will select the appropriate provider and call this method to let the actual service initialize itself. All further accept requests on this port will wait while the service is initialized. Upon successful completion of service initialization, all pending requests are passed to the service using the handleRequest method
        Specified by:
        initializeService in interface LazyServiceInitializer
        Returns:
        Return true if service initialization went through fine; false otherwise
      • handleRequest

        public void handleRequest​(SelectableChannel channel)
        Description copied from interface: LazyServiceInitializer
        Upon successful ACCEPT of every request on this port, the service is called upon to handle the request. The service is provided the channel itself. The service can setup connection, its characteristics, decide on blocking/non-blocking modes etc. The service is expected to return control back to the listener ASAP without consuming this thread for processing the requst completely.
        Specified by:
        handleRequest in interface LazyServiceInitializer
        Parameters:
        channel - where the incoming request was accepted.