Package org.qi4j.api.service

Examples of org.qi4j.api.service.ServiceReference


    Map<Type, ServiceReference> serviceReferences = new ConcurrentHashMap<Type, ServiceReference>();
    Map<Type, Iterable<ServiceReference>> servicesReferences = new ConcurrentHashMap<Type, Iterable<ServiceReference>>();

    public <T> ServiceReference<T> findService( final Class<T> serviceType )
    {
        ServiceReference serviceReference = serviceReferences.get( serviceType );
        if( serviceReference == null )
        {
            serviceReference = Iterables.first( findServices( serviceType ));
            if( serviceReference != null )
            {
View Full Code Here


    }

    @Override
    public <T> ServiceReference<T> findService( Type serviceType )
    {
        ServiceReference serviceReference = serviceReferences.get( serviceType );
        if( serviceReference == null )
        {
            serviceReference = Iterables.first( findServices( serviceType ));
            if( serviceReference != null )
            {
View Full Code Here

        }
        if( getClass() != obj.getClass() )
        {
            return false;
        }
        final ServiceReference other = (ServiceReference) obj;
        return identity().equals( other.identity() );
    }
View Full Code Here

            return false;
        }
        if ( getClass() != obj.getClass() ) {
            return false;
        }
        final ServiceReference other = ( ServiceReference ) obj;
        return identity().equals( other.identity() );
    }
View Full Code Here

            }
            if( getClass() != obj.getClass() )
            {
                return false;
            }
            final ServiceReference other = (ServiceReference) obj;
            return identity().equals( other.identity() );
        }
View Full Code Here

        }

        public String restart()
        {
            Iterable services = module.findServices( first( serviceDescriptor.types() ) );
            ServiceReference serviceRef = ( ServiceReference ) Iterables.first( Iterables.filter( ServiceQualifier.withId( serviceDescriptor.identity() ), services ) );
            if( serviceRef != null )
            {
                try
                {
                    ( (Activation) serviceRef ).passivate();
View Full Code Here

        Module module;

        @Override
        public boolean isValid( ServiceAvailable serviceAvailable, ObjectSelection objectSelection )
        {
            ServiceReference ref = module.findService( serviceAvailable.value() );
            return ref != null && ref.isAvailable();
        }
View Full Code Here

TOP

Related Classes of org.qi4j.api.service.ServiceReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.