Examples of addContextName()


Examples of org.apache.tuscany.core.context.TargetException.addContextName()

        if (context == null) {
            Context iContext = container.getContext(esName);
            if (!(iContext instanceof AtomicContext)) {
                TargetException te = new TargetException("Unexpected target context type");
                te.setIdentifier(iContext.getClass().getName());
                te.addContextName(iContext.getName());
                throw te;
            }
            context = (AtomicContext) iContext;
        }
View Full Code Here

Examples of org.apache.tuscany.core.context.TargetException.addContextName()

        if (context == null) {
            Context iContext = container.getContext(esName);
            if (!(iContext instanceof ExternalServiceContext)) {
                TargetException te = new TargetException("Unexpected target context type");
                te.setIdentifier(iContext.getClass().getName());
                te.addContextName(iContext.getName());
                throw te;
            }
            context = (ExternalServiceContext) iContext;
        }
View Full Code Here

Examples of org.apache.tuscany.core.context.TargetException.addContextName()

        try {
            return targetWireFactory.createProxy();
            // TODO do we cache the proxy, (assumes stateful capabilities will be provided in an interceptor)
        } catch (ProxyCreationException e) {
            TargetException te = new TargetException(e);
            te.addContextName(getName());
            throw te;
        }
    }

    public Object getHandler() throws TargetException {
View Full Code Here

Examples of org.apache.tuscany.core.context.TargetException.addContextName()

        if (proxy == null) {
            try {
                proxy = sourceWireFactory.createProxy();
            } catch (ProxyCreationException e) {
                TargetException te = new TargetException(e);
                te.addContextName(getName());
                throw te;
            }
        }
        return proxy;
    }
View Full Code Here

Examples of org.apache.tuscany.spi.builder.BuilderConfigException.addContextName()

        Class<?> implClass = componentDefinition.getImplementation().getClass();
        ComponentBuilder<I> componentBuilder = (ComponentBuilder<I>) componentBuilders.get(implClass);
        if (componentBuilder == null) {
            BuilderConfigException e = new BuilderConfigException("No builder registered for implementation");
            e.setIdentifier(implClass.getName());
            e.addContextName(componentDefinition.getName());
            throw e;
        }

        Component component = componentBuilder.build(parent, componentDefinition, deploymentContext);
        ComponentType<?, ?, ?> componentType = componentDefinition.getImplementation().getComponentType();
View Full Code Here

Examples of org.apache.tuscany.spi.component.ComponentNotFoundException.addContextName()

    public Service getService(String name) {
        SCAObject ctx = children.get(name);
        if (ctx == null) {
            ComponentNotFoundException e = new ComponentNotFoundException("Service not found");
            e.setIdentifier(name);
            e.addContextName(getName());
            throw e;
        } else if (!(ctx instanceof Service)) {
            ComponentNotFoundException e = new ComponentNotFoundException("SCAObject not a service");
            e.setIdentifier(name);
            e.addContextName(getName());
View Full Code Here

Examples of org.apache.tuscany.spi.component.DuplicateNameException.addContextName()

        if (child.isSystem()) {
            if (systemChildren.get(child.getName()) != null) {
                DuplicateNameException e =
                    new DuplicateNameException("A system child is already registered with the name");
                e.setIdentifier(child.getName());
                e.addContextName(getName());
                throw e;
            }
            systemChildren.put(child.getName(), child);
        } else {
            if (children.get(child.getName()) != null) {
View Full Code Here

Examples of org.apache.tuscany.spi.component.IllegalTargetException.addContextName()

        } else if (context instanceof Service) {
            return context.getServiceInstance();
        } else {
            IllegalTargetException e = new IllegalTargetException("Target must be a service");
            e.setIdentifier(name);
            e.addContextName(getName());
            throw e;
        }
    }

    public Object getSystemServiceInstance(String name) throws TargetException {
View Full Code Here

Examples of org.apache.tuscany.spi.component.ReferenceNotFoundException.addContextName()

            Map<String, ? extends ReferenceDefinition> references = componentType.getReferences();
            ReferenceDefinition mappedReference = references.get(referenceTarget.getReferenceName());
            if (mappedReference == null) {
                String refName = referenceTarget.getReferenceName();
                ReferenceNotFoundException e = new ReferenceNotFoundException(refName);
                e.addContextName(refName);
                e.addContextName(definition.getName());
                throw e;
            }
            OutboundWire wire = createWire(referenceTarget, mappedReference);
            wire.setContainer(component);
View Full Code Here

Examples of org.apache.tuscany.spi.component.TargetNotFoundException.addContextName()

    public <T> T locateService(Class<T> serviceInterface, String name) {
        SCAObject target = children.get(name);
        if (target == null) {
            TargetNotFoundException e = new TargetNotFoundException(name);
            e.addContextName(getName());
            throw e;
        }
        return serviceInterface.cast(target.getServiceInstance());
    }
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.