Class ServiceListenerFuture<S,​V>

  • All Implemented Interfaces:
    java.util.concurrent.Future<V>, org.jboss.msc.service.ServiceListener<S>

    public abstract class ServiceListenerFuture<S,​V>
    extends org.jboss.msc.service.AbstractServiceListener<S>
    implements org.jboss.msc.service.ServiceListener<S>, java.util.concurrent.Future<V>

    A Future implementation backed by a ServiceListener

    Author:
    Daniel Meyer
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cancel​(boolean mayInterruptIfRunning)  
      V get()  
      V get​(long timeout, java.util.concurrent.TimeUnit unit)  
      boolean isCancelled()  
      boolean isDone()  
      protected abstract void serviceAvailable()  
      void transition​(org.jboss.msc.service.ServiceController<? extends S> controller, org.jboss.msc.service.ServiceController.Transition transition)  
      • Methods inherited from class org.jboss.msc.service.AbstractServiceListener

        dependencyFailed, dependencyFailureCleared, immediateDependencyAvailable, immediateDependencyUnavailable, listenerAdded, serviceRemoveRequestCleared, serviceRemoveRequested, transitiveDependencyAvailable, transitiveDependencyUnavailable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.jboss.msc.service.ServiceListener

        dependencyFailed, dependencyFailureCleared, immediateDependencyAvailable, immediateDependencyUnavailable, listenerAdded, serviceRemoveRequestCleared, serviceRemoveRequested, transitiveDependencyAvailable, transitiveDependencyUnavailable
    • Field Detail

      • serviceInstance

        protected final S serviceInstance
      • value

        protected V value
    • Constructor Detail

      • ServiceListenerFuture

        public ServiceListenerFuture​(S serviceInstance)
    • Method Detail

      • transition

        public void transition​(org.jboss.msc.service.ServiceController<? extends S> controller,
                               org.jboss.msc.service.ServiceController.Transition transition)
        Specified by:
        transition in interface org.jboss.msc.service.ServiceListener<S>
        Overrides:
        transition in class org.jboss.msc.service.AbstractServiceListener<S>
      • serviceAvailable

        protected abstract void serviceAvailable()
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<S>
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<S>
      • isDone

        public boolean isDone()
        Specified by:
        isDone in interface java.util.concurrent.Future<S>
      • get

        public V get()
              throws java.lang.InterruptedException,
                     java.util.concurrent.ExecutionException
        Specified by:
        get in interface java.util.concurrent.Future<S>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • get

        public V get​(long timeout,
                     java.util.concurrent.TimeUnit unit)
              throws java.lang.InterruptedException,
                     java.util.concurrent.ExecutionException,
                     java.util.concurrent.TimeoutException
        Specified by:
        get in interface java.util.concurrent.Future<S>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException