Examples of ServiceProvider


Examples of ag.ion.noa.internal.service.ServiceProvider

   */
  public IServiceProvider getServiceProvider() {
    if (!active || officeConnection == null)
      return null;

    return new ServiceProvider(officeConnection);
  }
View Full Code Here

Examples of com.dyuproject.oauth.sp.ServiceProvider

        {
            throw new RuntimeException(ioe);
        }
       
        PropertiesHashStore store = new PropertiesHashStore(consumers, "secret", "macSecret");
        ServiceProvider serviceProvider = new ServiceProvider(store);
        event.getServletContext().setAttribute(ServiceProvider.class.getName(), serviceProvider);
        System.err.println("ServiceProvider initialized.");
    }
View Full Code Here

Examples of com.hetty.object.ServiceProvider

          providerClass = Class.forName(processor);
        } catch (ClassNotFoundException e) {
          logger.error(e.getMessage());
          throw new RuntimeException("can't find service provider Class:"+processor);
        }
        ServiceProvider sv = new ServiceProvider(version, providerClass);
        if (StringUtil.isNotEmpty(version) && StringUtil.isNotEmpty(isDefault)
            && "true".equals(isDefault.trim())) {
          service.setDefaultVersion(version);
        }
        service.addServiceProvider(version,sv);
View Full Code Here

Examples of com.tacitknowledge.flip.spi.ServiceProvider

        {
            environment.setProperties(properties);
        }

        packagesToSearch = ArrayUtils.add(packagesToSearch, getClass().getPackage().getName());
        final ServiceProvider serviceProvider = new ServiceProvider(packagesToSearch);

        final List<PropertyReader> propertyReaders = Lists.newArrayList(serviceProvider.find(FlipProperty.class,
                PropertyReader.class));
        Collections.sort(propertyReaders, new FlipPropertiesPriorityComparator());
        environment.setPropertyReaders(propertyReaders);

        final List<Object> contextProviders = Lists.newArrayList(serviceProvider.find(FlipContext.class));
        Collections.sort(contextProviders, new FlipContextsPriorityComparator());
        environment.setContextProviders(contextProviders);

        return environment;
    }
View Full Code Here

Examples of net.hasor.rsf.client.ServiceProvider

* @version : 2014年9月19日
* @author 赵永春(zyc@hasor.net)
*/
public class MyServiceProvider {
    public static void main(String[] args) {
        ServiceProvider sp = new ServiceProvider();
        sp.initService();
        //
        // TODO Auto-generated method stub
    }
View Full Code Here

Examples of org.apache.curator.x.discovery.ServiceProvider

  {
    if (serviceName == null) {
      return new ServerDiscoverySelector(new NoopServiceProvider());
    }

    final ServiceProvider serviceProvider = serviceDiscovery
        .serviceProviderBuilder()
        .serviceName(CuratorServiceUtils.makeCanonicalServiceName(serviceName))
        .build();
    return new ServerDiscoverySelector(serviceProvider);
  }
View Full Code Here

Examples of org.apache.openejb.config.sys.ServiceProvider

            service = getDefaultService(infoType);
        }

        String providerType = service.getClass().getSimpleName();

        ServiceProvider provider = resolveServiceProvider(service, infoType);

        if (provider == null){
            throw new NoSuchProviderException("Cannot determine a default provider for Service("+service.getId() +", "+infoType.getSimpleName()+")");
        }

        if (service.getId() == null) service.setId(provider.getId());

        logger.info("Configuring Service(id=" + service.getId() + ", type=" + provider.getService() + ", provider-id=" + provider.getId() + ")");

        Properties props = new Properties();
        props.putAll(provider.getProperties());
        props.putAll(service.getProperties());
        props.putAll(getSystemProperties(service.getId()));

        if (providerType != null && !provider.getService().equals(providerType)) {
            throw new OpenEJBException(messages.format("conf.4902", service.getId(), providerType));
        }

        T info = null;

        try {
            info = infoType.newInstance();
        } catch (Exception e) {
            throw new OpenEJBException("Cannot instantiate class " + infoType.getName(), e);
        }

        info.service = provider.getService();
        info.types.addAll(provider.getTypes());
        info.description = provider.getDescription();
        info.displayName = provider.getDisplayName();
        info.className = provider.getClassName();
        info.factoryMethod = provider.getFactoryName();
        info.id = service.getId();
        info.properties = props;
        info.constructorArgs.addAll(parseConstructorArgs(provider));

        return info;
View Full Code Here

Examples of org.apache.openejb.config.sys.ServiceProvider

    public static String getServiceProviderId(String type) throws OpenEJBException {
        return getServiceProviderId(type, null);
    }

    public static String getServiceProviderId(String type, Properties required) throws OpenEJBException {
        ServiceProvider provider = getServiceProviderByType(type, required);

        return provider != null? provider.getId(): null;
    }
View Full Code Here

Examples of org.apache.openejb.config.sys.ServiceProvider

            ResourceAdapter resourceAdapter = connector.getResourceAdapter();
            if (resourceAdapter.getResourceAdapterClass() != null) {
                String id = getId(connectorModule);
                String className = resourceAdapter.getResourceAdapterClass();

                ServiceProvider provider = new ServiceProvider(className, id, "Resource");
                provider.getTypes().add(className);

                ServiceUtils.registerServiceProvider(appId, provider);

                Resource resource = new Resource(id, className, appId + "#" + id);

                for (ConfigProperty property : resourceAdapter.getConfigProperty()) {
                    String name = property.getConfigPropertyName();
                    String value = property.getConfigPropertyValue();
                    if (value != null) {
                        resource.getProperties().setProperty(name, value);
                    }
                }
                connectorInfo.resourceAdapter = configFactory.configureService(resource, ResourceInfo.class);
            }

            OutboundResourceAdapter outbound = resourceAdapter.getOutboundResourceAdapter();
            if (outbound != null) {
                String transactionSupport = "none";
                switch (outbound.getTransactionSupport()) {
                    case LOCAL_TRANSACTION:
                        transactionSupport = "local";
                        break;
                    case NO_TRANSACTION:
                        transactionSupport = "none";
                        break;
                    case XA_TRANSACTION:
                        transactionSupport = "xa";
                        break;
                }
                for (ConnectionDefinition connection : outbound.getConnectionDefinition()) {

                    String id = getId(connection, outbound, connectorModule);
                    String className = connection.getManagedConnectionFactoryClass();
                    String type = connection.getConnectionFactoryInterface();

                    ServiceProvider provider = new ServiceProvider(className, id, "Resource");
                    provider.getTypes().add(type);

                    ServiceUtils.registerServiceProvider(appId, provider);

                    Resource resource = new Resource(id, type, appId + "#" + id);
                    Properties properties = resource.getProperties();
                    for (ConfigProperty property : connection.getConfigProperty()) {
                        String name = property.getConfigPropertyName();
                        String value = property.getConfigPropertyValue();
                        if (value != null) {
                            properties.setProperty(name, value);
                        }
                    }
                    properties.setProperty("TransactionSupport", transactionSupport);
                    properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);

                    ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
                    connectorInfo.outbound.add(resourceInfo);
                }
            }

            InboundResource inbound = resourceAdapter.getInboundResourceAdapter();
            if (inbound != null) {
                for (MessageListener messageListener : inbound.getMessageAdapter().getMessageListener()) {
                    String id = getId(messageListener, inbound, connectorModule);

                    Container container = new Container(id, "MESSAGE", null);

                    Properties properties = container.getProperties();
                    properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);
                    properties.setProperty("MessageListenerInterface", messageListener.getMessageListenerType());
                    properties.setProperty("ActivationSpecClass", messageListener.getActivationSpec().getActivationSpecClass());

                    MdbContainerInfo mdbContainerInfo = configFactory.configureService(container, MdbContainerInfo.class);
                    connectorInfo.inbound.add(mdbContainerInfo);
                }
            }

            for (AdminObject adminObject : resourceAdapter.getAdminObject()) {

                String id = getId(adminObject, resourceAdapter, connectorModule);
                String className = adminObject.getAdminObjectClass();
                String type = adminObject.getAdminObjectInterface();

                ServiceProvider provider = new ServiceProvider(className, id, "Resource");
                provider.getTypes().add(type);

                ServiceUtils.registerServiceProvider(appId, provider);

                Resource resource = new Resource(id, type, appId + "#" + id);
                Properties properties = resource.getProperties();
View Full Code Here

Examples of org.apache.openejb.config.sys.ServiceProvider

            }


            String providerType = service.getClass().getSimpleName();

            ServiceProvider provider = resolveServiceProvider(service, infoType);

            if (provider == null){
                List<ServiceProvider> providers = ServiceUtils.getServiceProvidersByServiceType(providerType);
                StringBuilder sb = new StringBuilder();
//                for (ServiceProvider p : providers) {
//                    sb.append(System.getProperty("line.separator"));
//                    sb.append("  <").append(p.getService());
//                    sb.append(" id=\"").append(service.getId()).append('"');
//                    sb.append(" provider=\"").append(p.getId()).append("\"/>");
//                }

                List<String> types = new ArrayList<String>();
                for (ServiceProvider p : providers) {
                    for (String type : p.getTypes()) {
                        if (types.contains(type)) continue;
                        types.add(type);
                        sb.append(System.getProperty("line.separator"));
                        sb.append("  <").append(p.getService());
                        sb.append(" id=\"").append(service.getId()).append('"');
                        sb.append(" type=\"").append(type).append("\"/>");
                    }
                }
                String noProviderMessage = messages.format("configureService.noProviderForService", providerType, service.getId(), service.getType(), service.getProvider(), sb.toString());
                throw new NoSuchProviderException(noProviderMessage);
            }

            if (service.getId() == null) service.setId(provider.getId());

            logger.info("configureService.configuring", service.getId(), provider.getService(), provider.getId());

            Properties props = new SuperProperties();
            props.putAll(provider.getProperties());
            props.putAll(service.getProperties());
            props.putAll(getSystemProperties(service.getId(), provider.getService()));

            if (providerType != null && !provider.getService().equals(providerType)) {
                throw new OpenEJBException(messages.format("configureService.wrongProviderType", service.getId(), providerType));
            }

            T info;
            try {
                info = infoType.newInstance();
            } catch (Exception e) {
                throw new OpenEJBException(messages.format("configureService.cannotInstantiateClass", infoType.getName()), e);
            }

            info.service = provider.getService();
            info.types.addAll(provider.getTypes());
            info.description = provider.getDescription();
            info.displayName = provider.getDisplayName();
            info.className = provider.getClassName();
            info.factoryMethod = provider.getFactoryName();
            info.id = service.getId();
            info.properties = props;
            info.constructorArgs.addAll(parseConstructorArgs(provider));

            specialProcessing(info);
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.