Examples of ServiceReference


Examples of org.osgi.framework.ServiceReference

    final String si = (String) opts.get("interface");
    final String filterArg = (String) opts.get("-f");
    final String filter = null==filterArg
      ? null
      : "(&(objectClass=" +si +")" +filterArg +")";
    final ServiceReference sr = (ServiceReference) AccessController
      .doPrivileged(new PrivilegedAction() {
          public Object run() {
            ServiceReference res = null;
            if (null==filter) {
              res = bc.getServiceReference(si);
              if (null==res) {
                out.println("No service with interface '" + si +"'.");
              }
View Full Code Here

Examples of org.osgi.framework.ServiceReference

    });
  }

  private void log(int level, String message)
  {
    ServiceReference sRef =
      bc.getServiceReference(LogService.class.getName());
    if (sRef != null) {
      LogService log = (LogService) bc.getService(sRef);
      if (log != null) {
        log.log(level, message);
View Full Code Here

Examples of org.osgi.framework.ServiceReference

            boolean requireUM = telnetConfig.umRequired();
            String requiredGroup = telnetConfig.getRequiredGroup();
            String forbiddenGroup = telnetConfig.getForbiddenGroup();

            ServiceReference sr = bc
                    .getServiceReference(PasswdAuthenticator.class.getName());
            TelnetLogin telnetLogin = new TelnetLogin(false, null, userName);

            // Only one of the following if cases (1,2 or 3) is executed
View Full Code Here

Examples of org.osgi.framework.ServiceReference

     *
     * @param se
     *            the service event that has occured.
     */
    public void serviceChanged(ServiceEvent se) {
        ServiceReference sr = se.getServiceReference();
        Bundle bundle = sr.getBundle();
        String msg = null;
        int level = LogService.LOG_INFO;
        switch (se.getType()) {
        case ServiceEvent.REGISTERED:
            msg = "ServiceEvent REGISTERED";
View Full Code Here

Examples of org.osgi.framework.ServiceReference

    // --
    public void setIPAMContext(String inputPath, String authMethod) {
        int authLevel = Levels.LOWEST;
        int confLevel = Levels.LOWEST;
        int integrLevel = Levels.LOWEST;
        ServiceReference ipamsr = Activator.bc
                .getServiceReference(IPAMValuationService.class.getName());
        if (ipamsr != null) {
            IPAMValuationService ipam = (IPAMValuationService) Activator.bc
                    .getService(ipamsr);
            if (ipam != null) {
View Full Code Here

Examples of org.osgi.framework.ServiceReference

   * *************** Called from set methods *********************
   */

  private void updateConfig() {
    try {
      ServiceReference sr = bc
          .getServiceReference(ConfigurationAdmin.class.getName());
      if (sr != null) {
        ConfigurationAdmin ca = (ConfigurationAdmin) bc.getService(sr);
        if (ca != null) {
          Configuration conf = ca.getConfiguration(pid);
View Full Code Here

Examples of org.osoa.sca.ServiceReference

        System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString);

        boolean exceptionProduced = false;
        RequestContext requestContext = null;
        ServiceReference serviceRef = null;

        // Context is not working properly so we can't trust that this is
        // working.....
        try {
            requestContext = context.getRequestContext();
            serviceRef = (ServiceReference) requestContext.getServiceReference();
        } catch (Exception ex) {
            System.out.println("CallBackBasicServiceImpl.setCallbackIllegally()  " + ex.toString());
            ex.printStackTrace();
            return;
        }

        // Ok, call setCallback with my own service reference.
        try {
            serviceRef.setCallback(serviceRef);
        } catch (NullPointerException npe) {
            // This is not an appropriate exception.
            System.out.println("Test10 NPE exception during setCallback to own service reference");
            npe.printStackTrace();
            return;
View Full Code Here

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

Examples of org.switchyard.ServiceReference

            }
            ServiceDomain serviceDomain = getServiceDomain();
            if (serviceDomain == null) {
                throw CommonKnowledgeMessages.MESSAGES.serviceDomainNull();
            }
            ServiceReference serviceReference = serviceDomain.getServiceReference(serviceName);
            if (serviceReference == null) {
                throw CommonKnowledgeMessages.MESSAGES.serviceReferenceNull(serviceName.toString());
            }
            final Exchange exchangeIn;
            FaultHandler handler = new FaultHandler();
            String operationName = request.getOperationName();
            if (operationName != null) {
                exchangeIn = serviceReference.createExchange(operationName, handler);
            } else {
                exchangeIn = serviceReference.createExchange(handler);
            }
            Message messageIn = exchangeIn.createMessage();
            Context contextIn = exchangeIn.getContext(messageIn);
            for (Map.Entry<String,Object> entry : request.getContext().entrySet()) {
                contextIn.setProperty(entry.getKey(), entry.getValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.