@Deprecated public void start(CompositeContext compositeContext, RuntimeEndpointReference endpointReference) { compositeContext.getEndpointRegistry().addEndpointReference(endpointReference); // The act of getting invocation chains starts the reference in the late binding case // so just use that here endpointReference.getInvocationChains(); }
public void bind(CompositeContext compositeContext) { this.compositeContext = compositeContext; bind(compositeContext.getExtensionPointRegistry(), compositeContext.getEndpointRegistry()); }
public void bind(CompositeContext compositeContext) { this.compositeContext = compositeContext; bind(compositeContext.getExtensionPointRegistry(), compositeContext.getEndpointRegistry()); }
/** * Start the callback endpoint * @param compositeContext - the composite context * @param ep - the endpoint to start */ private void startEndpoint(CompositeContext compositeContext, RuntimeEndpoint ep) { for (PolicyProvider policyProvider : ep.getPolicyProviders()) { policyProvider.start(); } // end for final ServiceBindingProvider bindingProvider = ep.getBindingProvider(); if (bindingProvider != null) { // Allow bindings to add shutdown hooks. Requires RuntimePermission shutdownHooks in policy. AccessController.doPrivileged(new PrivilegedAction<Object>() { public Object run() { bindingProvider.start(); return null; } }); compositeContext.getEndpointRegistry().addEndpoint(ep); } } // end method startEndpoint
/** * This code used to be in the activator but has moved here as * the endpoint reference may not now be resolved until the wire * is first used */ private void resolveEndpointReference() { resolve(); eprBinder.bindRunTime(domainRegistry, this); // start the binding provider final ReferenceBindingProvider bindingProvider = getBindingProvider(); if (bindingProvider != null) { // Allow bindings to add shutdown hooks. Requires RuntimePermission shutdownHooks in policy. AccessController.doPrivileged(new PrivilegedAction<Object>() { public Object run() { bindingProvider.start(); return null; } }); } for (PolicyProvider policyProvider : getPolicyProviders()) { policyProvider.start(); } started = true; Contract ref = getReference(); String refName = ref.getName(); if (!refName.startsWith("$self$.") && !refName.startsWith("$sca.client$.") && !ref.isForCallback()) compositeContext.getEndpointRegistry().addEndpointReference(this); // InterfaceContract bindingContract = getBindingInterfaceContract(); // endpoint.setInterfaceContract(bindingContract); }
public void stop(RuntimeEndpoint ep) { ep.getCompositeContext().getEndpointRegistry().removeEndpoint(ep); final ServiceBindingProvider bindingProvider = ep.getBindingProvider(); if (bindingProvider != null) { try { // Allow bindings to read properties. Requires PropertyPermission read in security policy. AccessController.doPrivileged(new PrivilegedAction<Object>() { public Object run() { bindingProvider.stop(); return null; } }); } catch (Throwable ex){ Monitor.error(monitor, this, "core-messages", "StopException", ex); } } for (PolicyProvider policyProvider : ep.getPolicyProviders()) { try { policyProvider.stop(); } catch (Throwable ex){ Monitor.error(monitor, this, "core-messages", "StopException", ex); } } }
compositeContext.getEndpointRegistry().addEndpoint(ep); } catch (Throwable ex){ Monitor.error(monitor, this, "core-messages", "StartException", ex);
public void stop(RuntimeEndpointReference epr) { if (epr.isStarted()) { CompositeContext compositeContext = epr.getCompositeContext(); if (compositeContext == null) { throw new IllegalStateException("The endpoint reference is not bound"); } compositeContext.getEndpointRegistry().removeEndpointReference(epr); ReferenceBindingProvider bindingProvider = epr.getBindingProvider(); if (bindingProvider != null) { try { bindingProvider.stop(); } catch (Throwable ex){ Monitor.error(monitor, this, "core-messages", "StopException", ex); } } for (PolicyProvider policyProvider : epr.getPolicyProviders()) { try { policyProvider.stop(); } catch (Throwable ex){ Monitor.error(monitor, this, "core-messages", "StopException", ex); } } } } }
DomainRegistry domainRegistry = compositeContext.getEndpointRegistry(); if (!domainRegistry.isDistributed()) { for (Endpoint e : configuration.getEndpointDescriptions()) {
DomainRegistry domainRegistry = compositeContext.getEndpointRegistry(); if (!domainRegistry.isDistributed()) { for (Endpoint e : configuration.getEndpointDescriptions()) {
/** * Choose the physical binding for service-side remotable binding.sca * @param endpoint * @return */ protected QName chooseBinding(RuntimeEndpoint endpoint) { DomainRegistry domainRegistry = endpoint.getCompositeContext().getEndpointRegistry(); boolean distributed = alwaysDistributed || domainRegistry.isDistributed(); InterfaceContract interfaceContract = endpoint.getService().getInterfaceContract(); if(interfaceContract != null && interfaceContract.getInterface() != null && interfaceContract.getInterface().isRemotable() && distributed && isBindingSupported(defaultMappedBinding)) { return defaultMappedBinding; } return defaultLocalBinding; }
/** * Choose the physical binding for service-side remotable binding.sca * @param endpoint * @return */ protected QName chooseBinding(RuntimeEndpoint endpoint) { DomainRegistry domainRegistry = endpoint.getCompositeContext().getEndpointRegistry(); boolean distributed = alwaysDistributed || domainRegistry.isDistributed(); InterfaceContract interfaceContract = endpoint.getService().getInterfaceContract(); if(interfaceContract != null && interfaceContract.getInterface() != null && interfaceContract.getInterface().isRemotable() && distributed && isBindingSupported(defaultMappedBinding)) { return defaultMappedBinding; } return defaultLocalBinding; }
/** * Choose the physical binding for reference-side remotable binding.sca * @param endpointReference * @return */ protected QName chooseBinding(RuntimeEndpointReference endpointReference) { DomainRegistry domainRegistry = endpointReference.getCompositeContext().getEndpointRegistry(); boolean distributed = alwaysDistributed || domainRegistry.isDistributed(); if(endpointReference.getTargetEndpoint().isRemote()) { RuntimeComponentReference ref = (RuntimeComponentReference)endpointReference.getReference(); if(ref.getInterfaceContract() != null && !ref.getInterfaceContract().getInterface().isRemotable()) { throw new ServiceRuntimeException("Reference interface not remotable for component: " + endpointReference.getComponent().getName() + " and reference: " + ref.getName()); } if(distributed && isBindingSupported(defaultMappedBinding)) { return defaultMappedBinding; } } return defaultLocalBinding; }
/** * Choose the physical binding for reference-side remotable binding.sca * @param endpointReference * @return */ protected QName chooseBinding(RuntimeEndpointReference endpointReference) { DomainRegistry domainRegistry = endpointReference.getCompositeContext().getEndpointRegistry(); boolean distributed = alwaysDistributed || domainRegistry.isDistributed(); if(endpointReference.getTargetEndpoint().isRemote()) { RuntimeComponentReference ref = (RuntimeComponentReference)endpointReference.getReference(); if(ref.getInterfaceContract() != null && !ref.getInterfaceContract().getInterface().isRemotable()) { throw new ServiceRuntimeException("Reference interface not remotable for component: " + endpointReference.getComponent().getName() + " and reference: " + ref.getName()); } if(distributed && isBindingSupported(defaultMappedBinding)) { return defaultMappedBinding; } } return defaultLocalBinding; }