Examples of ServiceDiscovery


Examples of com.anzsoft.client.XMPP.mandioca.ServiceDiscovery

  {
    initConnection();
    if(eventAdapter != null)
      connection.addEventListener(eventAdapter);
    session = new XmppSession(connection, true);
    disco = new ServiceDiscovery(session);
    new XmppPushRoster(session);
    XmppUserSettings userSetting = new XmppUserSettings(host,port,domain, user, pass, AuthType.fromString(authType));
    session.login(userSetting);
    session.getUser().getRoster().addRosterListener(createRosterListener());
  }
View Full Code Here

Examples of com.anzsoft.client.XMPP.mandioca.ServiceDiscovery

    this.domain = domain;
    initConnection();
    if(eventAdapter != null)
      connection.addEventListener(eventAdapter);
    session = new XmppSession(connection, true);
    disco = new ServiceDiscovery(session);
    new XmppPushRoster(session);
    XmppUserSettings userSetting;
    if(sasl)
      userSetting = new XmppUserSettings(host,port,domain, user, pass, XmppUserSettings.SASL);
    else
View Full Code Here

Examples of org.apache.commons.discovery.ServiceDiscovery

     * Attempts to resolve the given URI to be associated with a TagLibrary
     * otherwise null is returned to indicate no tag library could be found
     * so that the namespace URI should be treated as just vanilla XML.
     */   
    public TagLibrary resolveTagLibrary(String uri) {
        ServiceDiscovery discovery = getServiceDiscovery();
        String name = uri;
        if ( uri.startsWith( "jelly:" ) ) {
            name = "jelly." + uri.substring(6);
        }
       
        log.info( "Looking up service name: " + name );
       
        ServiceInfo[] infoArray = discovery.findServices(name);
       
        if ( infoArray != null && infoArray.length > 0 ) {
            for (int i = 0; i < infoArray.length; i++ ) {
                ServiceInfo info = infoArray[i];
                try {               
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.util.ServiceDiscovery

     */
    private List<ProviderFactory> loadProviderFactories(Class<?> factoryClass) {

        // Get the provider factory service declarations
        Set<ServiceDeclaration> factoryDeclarations;
        ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance();
        try {
            factoryDeclarations = serviceDiscovery.getServiceDeclarations(factoryClass);
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
       
        // Get the target extension point
View Full Code Here

Examples of org.apache.tuscany.sca.distributed.management.ServiceDiscovery

    public EndpointReference getServiceEndpoint(){
       
        if ( serviceEPR == null ){
            // try to resolve the service endpoint with the registry
            DistributedSCADomain distributedDomain = ((SCABindingImpl)binding).getDistributedDomain();
            ServiceDiscovery serviceDiscovery = distributedDomain.getServiceDiscovery();
           
            // The binding URI might be null in the case where this reference is completely
            // dynamic, for example, in the case of callbacks
            if (binding.getURI() != null) {
                String serviceUrl = serviceDiscovery.findServiceEndpoint(distributedDomain.getDomainName(),
                                                                         binding.getURI(),
                                                                         SCABinding.class.getName());
               
                if ( (serviceUrl != null ) &&
                     (!serviceUrl.equals(""))){
View Full Code Here

Examples of org.apache.tuscany.sca.distributed.management.ServiceDiscovery

       
        // get the url out of the binding and send it to the registry if
        // a distributed domain is configured
        DistributedSCADomain distributedDomain = ((SCABindingImpl)this.binding).getDistributedDomain();
       
        ServiceDiscovery serviceDiscovery = distributedDomain.getServiceDiscovery();
       
        // register endpoint against the path element of the binding uri
        String componentName = this.binding.getURI();
       
        try {
            URI servicePath = new URI(this.binding.getURI());
            componentName = servicePath.getPath();
           
            // strinp any leading slash
            if (componentName.charAt(0) == '/'){
                componentName = componentName.substring(1, componentName.length());
            }
        } catch(Exception ex) {
            // do nothing, the binding uri string will be used
        }


        serviceDiscovery.registerServiceEndpoint(distributedDomain.getDomainName(),
                                                 distributedDomain.getNodeName(),
                                                 componentName,
                                                 SCABinding.class.getName(),
                                                 wsBinding.getURI());
View Full Code Here

Examples of org.apache.tuscany.sca.distributed.management.ServiceDiscovery

            // reference, e.g. a callback, so check the domain to see if the service is available
            // at this node. The binding uri might be null here if the dynamic reference has been
            // fully configured yet. It won't have all of the information until invocation time
            if ((distributedDomain != null) &&
                (binding.getURI() != null) ) {
                ServiceDiscovery serviceDiscovery = distributedDomain.getServiceDiscovery();
               
                String serviceUrl = serviceDiscovery.findServiceEndpoint(distributedDomain.getDomainName(),
                                                                         binding.getURI(),
                                                                         SCABinding.class.getName());
                if (serviceUrl == null) {
                    targetIsRemote = false;
                } else {
View Full Code Here

Examples of org.apache.tuscany.sca.extensibility.ServiceDiscovery

        }
    }

    @Override
    public void configure(Map<String, Map<String, String>> attributes) {
        ServiceDiscovery discovery = getExtensionPointRegistry().getServiceDiscovery();
        for (Map.Entry<String, Map<String, String>> e : attributes.entrySet()) {
            discovery.setAttribute(e.getKey(), e.getValue());
        }
        for (Object o : properties.keySet()) {
            String p = (String) o;
            if (p.indexOf('.') > -1) {
                String serviceType = p.substring(0, p.lastIndexOf('.'));
                String attribute = p.substring(p.lastIndexOf('.')+1);
                discovery.setAttribute(serviceType, attribute, properties.getProperty(p));
            }
        }
        quietLogging = Boolean.parseBoolean(properties.getProperty(RuntimeProperties.QUIET_LOGGING));
        super.configure(attributes);
    }
View Full Code Here

Examples of org.apache.tuscany.sca.extensibility.ServiceDiscovery

        UtilityExtensionPoint utils = registry.getExtensionPoint(UtilityExtensionPoint.class);
        InterfaceContractMapper mapper = utils.getUtility(InterfaceContractMapper.class);

        // Get the provider factory service declarations
        Collection<ServiceDeclaration> builderDeclarations;
        ServiceDiscovery serviceDiscovery = registry.getServiceDiscovery();
        try {
            builderDeclarations = serviceDiscovery.getServiceDeclarations(CompositeBuilder.class.getName());
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }

        for (ServiceDeclaration builderDeclaration : builderDeclarations) {
            Map<String, String> attributes = builderDeclaration.getAttributes();
            String id = attributes.get("id");

            CompositeBuilder builder = new LazyCompositeBuilder(id, builderDeclaration, this, factories, mapper);
            builders.put(id, builder);
        }

        try {
            builderDeclarations = serviceDiscovery.getServiceDeclarations(BindingBuilder.class);
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }

        for (ServiceDeclaration builderDeclaration : builderDeclarations) {
            BindingBuilder<?> builder = new LazyBindingBuilder(builderDeclaration);
            bindingBuilders.put(builder.getBindingType(), builder);
        }

        try {
            builderDeclarations = serviceDiscovery.getServiceDeclarations(ImplementationBuilder.class);
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }

        for (ServiceDeclaration builderDeclaration : builderDeclarations) {
            ImplementationBuilder<?> builder = new LazyImplementationBuilder(builderDeclaration);
            implementationBuilders.put(builder.getImplementationType(), builder);
        }
       
        try {
            builderDeclarations = serviceDiscovery.getServiceDeclarations(PolicyBuilder.class);
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }

        for (ServiceDeclaration builderDeclaration : builderDeclarations) {
            PolicyBuilder<?> builder = new LazyPolicyBuilder(builderDeclaration);
            policyBuilders.put(builder.getPolicyType(), builder);
        }
       
        try {
            builderDeclarations = serviceDiscovery.getServiceDeclarations(ContractBuilder.class);
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
       
        for (ServiceDeclaration builderDeclaration : builderDeclarations) {
View Full Code Here

Examples of org.apache.tuscany.sca.extensibility.ServiceDiscovery

     */
    private List<ProviderFactory> loadProviderFactories(Class<?> factoryClass) {

        // Get the provider factory service declarations
        Set<ServiceDeclaration> factoryDeclarations;
        ServiceDiscovery serviceDiscovery = ServiceDiscovery.getInstance();
        try {
            factoryDeclarations = serviceDiscovery.getServiceDeclarations(factoryClass);
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }

        // Get the target extension point
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.