/** * URI construction for component bindings based on Assembly Specification section 1.7.2. This method * calculates the component URI part based on component information before calling the generic * constructBindingURI method * * @param component the component that holds the service * @param service the service that holds the binding * @param binding the binding for which the URI is being constructed * @param defaultBindings the list of default binding configurations */ private void constructBindingURI(Component component, Service service, Binding binding, Map<QName, List<String>> defaultBindings, Monitor monitor) throws CompositeBuilderException { constructBindingURI(component.getURI(), service, binding, defaultBindings, monitor); }
/** * URI construction for component bindings based on Assembly Specification section 1.7.2. This method * calculates the component URI part based on component information before calling the generic * constructBindingURI method * * @param component the component that holds the service * @param service the service that holds the binding * @param binding the binding for which the URI is being constructed * @param defaultBindings the list of default binding configurations */ private void constructBindingURI(Component component, Service service, Binding binding, Map<QName, List<String>> defaultBindings, Monitor monitor) throws CompositeBuilderException { constructBindingURI(component.getURI(), service, binding, defaultBindings, monitor); }
public String getURI() { if (uri == null) { if (component != null && service != null && binding != null) { String bindingName = binding.getName(); if (bindingName == null) { bindingName = service.getName(); } uri = component.getURI() + "#service-binding(" + service.getName() + "/" + bindingName + ")"; } else if (component != null && service != null) { uri = component.getURI() + "#service(" + service.getName() + ")"; } else if (component != null) { uri = component.getURI(); } } return uri; }
public String getURI() { if (uri == null) { if (component != null && reference != null && binding != null) { String bindingName = binding.getName(); if (bindingName == null) { bindingName = reference.getName(); } uri = component.getURI() + "#reference-binding(" + reference.getName() + "/" + bindingName + ")"; } else if (component != null && reference != null) { uri = component.getURI() + "#reference(" + reference.getName() + ")"; } else if (component != null) { uri = component.getURI(); } } return uri; }
public String getURI() { if (uri == null) { if (component != null && service != null && binding != null) { String bindingName = binding.getName(); if (bindingName == null) { bindingName = service.getName(); } uri = component.getURI() + "#service-binding(" + service.getName() + "/" + bindingName + ")"; } else if (component != null && service != null) { uri = component.getURI() + "#service(" + service.getName() + ")"; } else if (component != null) { uri = component.getURI(); } } return uri; }
public String getURI() { if (uri == null) { if (component != null && reference != null && binding != null) { String bindingName = binding.getName(); if (bindingName == null) { bindingName = reference.getName(); } uri = component.getURI() + "#reference-binding(" + reference.getName() + "/" + bindingName + ")"; } else if (component != null && reference != null) { uri = component.getURI() + "#reference(" + reference.getName() + ")"; } else if (component != null) { uri = component.getURI(); } } return uri; }
public void stop(Component component, ComponentReference reference) { if (logger.isLoggable(Level.FINE)) { logger.fine("Stopping component reference: " + component.getURI() + "#" + reference.getName()); } RuntimeComponentReference runtimeRef = ((RuntimeComponentReference)reference); for ( EndpointReference endpointReference : runtimeRef.getEndpointReferences()){ RuntimeEndpointReference epr = (RuntimeEndpointReference) endpointReference; stop(epr); } }
protected String getContext() { if (subject instanceof Endpoint) { Endpoint endpoint = (Endpoint)subject; return endpoint.getURI(); } else if (subject instanceof EndpointReference) { EndpointReference endpointReference = (EndpointReference)subject; return endpointReference.getURI(); } else if (subject instanceof Component) { Component component = (Component)subject; return component.getURI(); } return null; }
protected String getContext() { if (subject instanceof Endpoint) { Endpoint endpoint = (Endpoint)subject; return endpoint.getURI(); } else if (subject instanceof EndpointReference) { EndpointReference endpointReference = (EndpointReference)subject; return endpointReference.getURI(); } else if (subject instanceof Component) { Component component = (Component)subject; return component.getURI(); } return null; }
private String getContext() { if (subject instanceof Endpoint) { Endpoint endpoint = (Endpoint)subject; return endpoint.getURI(); } else if (subject instanceof EndpointReference) { EndpointReference endpointReference = (EndpointReference)subject; return endpointReference.getURI(); } else if (subject instanceof Component) { Component component = (Component)subject; return component.getURI(); } return null; }
/** * @param component */ public static ComponentService getSingleService(Component component) { ComponentService targetService; List<ComponentService> services = component.getServices(); List<ComponentService> regularServices = new ArrayList<ComponentService>(); for (ComponentService service : services) { if (service.isForCallback()) { continue; } String name = service.getName(); if (!name.startsWith("$") || name.startsWith("$dynamic$")) { regularServices.add(service); } } if (regularServices.size() == 0) { throw new ServiceRuntimeException("No service is declared on component " + component.getURI()); } if (regularServices.size() != 1) { throw new ServiceRuntimeException("More than one service is declared on component " + component.getURI() + ". Service name is required to get the service."); } targetService = regularServices.get(0); return targetService; }
String uri = component.getURI(); int index = uri.lastIndexOf('/'); if (index == -1) {
@Override public int complete(final String buffer, final int cursor, final List clist) { if (shell.getNode() != null) { List<String> services = new ArrayList<String>(); DomainRegistry reg = ((NodeImpl)shell.getNode()).getEndpointRegistry(); for (Endpoint endpoint : reg.getEndpoints()) { services.add(endpoint.getComponent().getURI() + "/" + endpoint.getService().getName()); } setCandidateStrings(services.toArray(new String[services.size()])); } return super.complete(buffer, cursor, clist); }
@Override public int complete(final String buffer, final int cursor, final List clist) { if (shell.getNode() != null) { List<String> services = new ArrayList<String>(); DomainRegistry reg = ((NodeImpl)shell.getNode()).getEndpointRegistry(); for (Endpoint endpoint : reg.getEndpoints()) { services.add(endpoint.getComponent().getURI() + "/" + endpoint.getService().getName()); } setCandidateStrings(services.toArray(new String[services.size()])); } return super.complete(buffer, cursor, clist); }
String uri = component.getURI(); int index = uri.lastIndexOf('/'); if (index == -1) {
public synchronized Endpoint getEndpoint(String uri) { for (Endpoint ep : endpoints) { String epURI = ep.getComponent().getURI() + "#" + ep.getService().getName() + "/" + ep.getBinding().getName(); if (epURI.equals(uri)) { return ep; } if (ep.getBinding().getName() == null || ep.getBinding().getName().equals(ep.getService().getName())) { epURI = ep.getComponent().getURI() + "#" + ep.getService().getName(); if (epURI.equals(uri)) { return ep; } } } return null; }
boolean services() throws IOException { if (getNode() == null) { return true; } DomainRegistry reg = ((NodeImpl)getNode()).getEndpointRegistry(); for (Endpoint endpoint : reg.getEndpoints()) { out.println(endpoint.getComponent().getURI() + "/" + endpoint.getService().getName()); for (Binding b : endpoint.getService().getBindings()) { if (!SCABinding.TYPE.equals(b.getType())) { out.println(" " + b.getType().getLocalPart() + " " + b.getURI()); } } } return true; }
boolean services() throws IOException { if (getNode() == null) { return true; } DomainRegistry reg = ((NodeImpl)getNode()).getEndpointRegistry(); for (Endpoint endpoint : reg.getEndpoints()) { out.println(endpoint.getComponent().getURI() + "/" + endpoint.getService().getName()); for (Binding b : endpoint.getService().getBindings()) { if (!SCABinding.TYPE.equals(b.getType())) { out.println(" " + b.getType().getLocalPart() + " " + b.getURI()); } } } return true; }
public void deactivateComponent(Component component) throws ActivationException { try { if (logger.isLoggable(Level.FINE)) { logger.fine("Deactivating component: " + component.getURI()); } for (ComponentService service : component.getServices()) { deactivate((RuntimeComponent) component, (RuntimeComponentService) service); } for (ComponentReference reference : component.getReferences()) { deactivate((RuntimeComponent) component, (RuntimeComponentReference) reference); } Implementation implementation = component.getImplementation(); if (implementation instanceof Composite) { deactivate((Composite) implementation); } else if (implementation != null) { removeImplementationProvider((RuntimeComponent) component); removeScopeContainer(component); } } catch (Exception e) { throw new ActivationException(e); } }
public void activateComponent(CompositeContext compositeContext, Component component) throws ActivationException { try { if (logger.isLoggable(Level.FINE)) { logger.fine("Activating component: " + component.getURI()); } Implementation implementation = component.getImplementation(); if (implementation instanceof Composite) { activate(compositeContext, (Composite) implementation); } else if (implementation != null) { addImplementationProvider((RuntimeComponent) component, implementation); addScopeContainer(component); } for (ComponentService service : component.getServices()) { activate(compositeContext, (RuntimeComponent) component, (RuntimeComponentService) service); } for (ComponentReference reference : component.getReferences()) { activate(compositeContext, (RuntimeComponent) component, (RuntimeComponentReference) reference); } } catch (Exception e) { throw new ActivationException(e); } }