public function lookup(ServiceContextInterface $serviceContext, $serviceIdentifier, array $args = array())
    {

        // first check if the service is available
        if ($serviceContext->getServices()->has($serviceIdentifier) === false) {
            throw new EnterpriseBeansException(
                sprintf(
                    'Requested service %s to handle %s is not available',
                    $serviceContext->getIdentifier(),
                    $serviceIdentifier
                )
            );
        }

        // return the initialized service instance
        return $serviceContext->getServices()->get($serviceIdentifier);
    }
public function lookup(ServiceContextInterface $serviceContext, $serviceIdentifier, array $args = array())
    {

        // first check if the service is available
        if ($serviceContext->getServices()->has($serviceIdentifier) === false) {
            throw new EnterpriseBeansException(
                sprintf(
                    'Requested service %s to handle %s is not available',
                    $serviceContext->getIdentifier(),
                    $serviceIdentifier
                )
            );
        }

        // return the initialized service instance
        return $serviceContext->getServices()->get($serviceIdentifier);
    }
public function lookup ( ServiceContextInterface $ serviceContext , $ serviceIdentifier , array $ args = array ( ) ) { // first check if the service is available if ( $ serviceContext -> getServices ( ) -> has ( $ serviceIdentifier ) === false ) { throw new EnterpriseBeansException ( sprintf ( 'Requested service %s to handle %s is not available' , $ serviceContext -> getIdentifier ( ) , $ serviceIdentifier ) ) ; } // return the initialized service instance return $ serviceContext -> getServices ( ) -> get ( $ serviceIdentifier ) ; }
Tries to lookup the service with the passed identifier.

@param \AppserverIo\Psr\EnterpriseBeans\ServiceContextInterface $serviceContext    The service context instance
@param string                                                   $serviceIdentifier The identifier of the service to be looked up
@param array                                                    $args              The arguments passed to the service providers constructor

@return \AppserverIo\Psr\EnterpriseBeans\ServiceProviderInterface The requested service provider instance
@throws \AppserverIo\Psr\EnterpriseBeans\EnterpriseBeansException Is thrown if the requested server can't be lookup up
@see \AppserverIo\Psr\EnterpriseBeans\ServiceResourceLocatorInterface::lookup()
Tries to lookup the service with the passed identifier .