Examples of RefContext


Examples of org.apache.geronimo.j2ee.deployment.RefContext

                        j2eeContext.getJ2eeApplicationName(),
                        null,
                        connectionTrackerName,
                        null,
                        null,
                        null, new RefContext(ejbReferenceBuilder,
                                moduleBuilder,
                                serviceReferenceBuilder, kernel));

                action.install(moduleBuilder, earContext, module);
                earContext.getClassLoader(null);
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

                moduleContext.getJ2eeApplicationName(),
                tcmName,
                ctcName,
                null,
                null,
                null, new RefContext(new EJBReferenceBuilder() {

                    public Reference createEJBLocalReference(String objectName, GBeanData gbeanData, boolean isSession, String localHome, String local) throws DeploymentException {
                        return null;
                    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

                    transactionContextManagerObjectName,
                    connectionTrackerObjectName,
                    null,
                    null,
                    corbaGBeanObjectName,
                    new RefContext(getEjbReferenceBuilder(), getResourceReferenceBuilder(), getServiceReferenceBuilder()));
            appClientModule.setEarContext(appClientDeploymentContext);
        } catch (DeploymentException e) {
            cleanupAppClientDir(appClientDir);
            throw e;
        }
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

            String name = (String) it.next();
            newMap.put(name.trim(), serviceRefMap.get(name));
        }
        serviceRefMap = newMap;

        RefContext refContext = earContext.getRefContext();

        for (int i = 0; i < serviceRefs.length; i++) {
            ServiceRefType serviceRef = serviceRefs[i];
            String name = getStringValue(serviceRef.getServiceRefName());
            GerServiceRefType serviceRefType = (GerServiceRefType) serviceRefMap.get(name);
//            Map credentialsNameMap = (Map) serviceRefCredentialsNameMap.get(name);
            String serviceInterfaceName = getStringValue(serviceRef.getServiceInterface());
            assureInterface(serviceInterfaceName, "javax.xml.rpc.Service", "[Web]Service", cl);
            Class serviceInterface;
            try {
                serviceInterface = cl.loadClass(serviceInterfaceName);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("Could not load service interface class: " + serviceInterfaceName, e);
            }
            URI wsdlURI = null;
            if (serviceRef.isSetWsdlFile()) {
                try {
                    wsdlURI = new URI(getStringValue(serviceRef.getWsdlFile().getStringValue()));
                } catch (URISyntaxException e) {
                    throw new DeploymentException("could not construct wsdl uri from " + serviceRef.getWsdlFile().getStringValue(), e);
                }
            }
            URI jaxrpcMappingURI = null;
            if (serviceRef.isSetJaxrpcMappingFile()) {
                try {
                    jaxrpcMappingURI = new URI(getStringValue(serviceRef.getJaxrpcMappingFile()));
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Could not construct jaxrpc mapping uri from " + serviceRef.getJaxrpcMappingFile(), e);
                }
            }
            QName serviceQName = null;
            if (serviceRef.isSetServiceQname()) {
                serviceQName = serviceRef.getServiceQname().getQNameValue();
            }
            Map portComponentRefMap = new HashMap();
            PortComponentRefType[] portComponentRefs = serviceRef.getPortComponentRefArray();
            if (portComponentRefs != null) {
                for (int j = 0; j < portComponentRefs.length; j++) {
                    PortComponentRefType portComponentRef = portComponentRefs[j];
                    String portComponentLink = getStringValue(portComponentRef.getPortComponentLink());
                    String serviceEndpointInterfaceType = getStringValue(portComponentRef.getServiceEndpointInterface());
                    assureInterface(serviceEndpointInterfaceType, "java.rmi.Remote", "ServiceEndpoint", cl);
                    Class serviceEndpointClass;
                    try {
                        serviceEndpointClass = cl.loadClass(serviceEndpointInterfaceType);
                    } catch (ClassNotFoundException e) {
                        throw new DeploymentException("could not load service endpoint class " + serviceEndpointInterfaceType, e);
                    }
                    portComponentRefMap.put(serviceEndpointClass, portComponentLink);
                }
            }
            ServiceRefHandlerType[] handlers = serviceRef.getHandlerArray();
            List handlerInfos = buildHandlerInfoList(handlers, cl);

//we could get a Reference or the actual serializable Service back.
            Object ref = refContext.getServiceReference(serviceInterface, wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlerInfos, serviceRefType, earContext, module, cl);
            builder.bind(name, ref);
        }

    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

                                            ServiceRefType[] serviceRefs,
                                            GerServiceRefType[] gerServiceRefs,
                                            GerGbeanRefType[] gerGbeanRefs,
                                            ClassLoader cl) throws DeploymentException {
        ComponentContextBuilder builder = new ComponentContextBuilder();
        RefContext refContext = earContext.getRefContext();
        Configuration earConfiguration = earContext.getConfiguration();

        if (userTransaction != null) {
            builder.addUserTransaction(userTransaction);
        }
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

                        transactionContextManagerName,
                        connectionTrackerName,
                        null,
                        null,
                        null,
                        new RefContext(ejbReferenceBuilder, moduleBuilder, serviceReferenceBuilder));

                action.install(moduleBuilder, earContext, module, configurationStore);
                earContext.getClassLoader();
                moduleBuilder.initContext(earContext, module, cl);
                moduleBuilder.addGBeans(earContext, module, cl, Collections.singleton(repository));
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

                new AbstractNameQuery(tcmName),
                new AbstractNameQuery(ctcName),
                null,
                null,
                null,
                new RefContext(new EJBReferenceBuilder() {


                    public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) {
                        return null;
                    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

                new AbstractNameQuery(tcmName),
                new AbstractNameQuery(ctcName),
                null,
                null,
                null,
                new RefContext(new EJBReferenceBuilder() {


                    public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) {
                        return null;
                    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

    private EARContext createEARContext(File outputPath, URI id)
            throws MalformedObjectNameException, DeploymentException {
        EARContext earContext = new EARContext(outputPath, id,
                ConfigurationModuleType.WAR, parentId, kernel, moduleContext
                        .getJ2eeApplicationName(), tcmName, ctcName, null,
                null, null, new RefContext(new EJBReferenceBuilder() {

                    public Reference createEJBLocalReference(String objectName,
                                                             GBeanData gbeanData, boolean isSession, String localHome, String local)
                            throws DeploymentException {
                        return null;
View Full Code Here

Examples of org.apache.geronimo.j2ee.deployment.RefContext

    static void addResourceRefs(EARContext earContext, URI moduleURI, ResourceRefType[] resourceRefs, Map refMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
        if (refMap == null) {
            refMap = Collections.EMPTY_MAP;
        }
        RefContext refContext = earContext.getRefContext();

        for (int i = 0; i < resourceRefs.length; i++) {
            ResourceRefType resourceRef = resourceRefs[i];
            String name = getStringValue(resourceRef.getResRefName());
            String type = getStringValue(resourceRef.getResType());
            GerResourceRefType gerResourceRef = (GerResourceRefType) refMap.get(name);
            Class iface = null;
            try {
                iface = cl.loadClass(type);
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("could not load class " + type, e);
            }
            Reference ref = null;
            if (iface == URL.class) {
                if (gerResourceRef == null || !gerResourceRef.isSetUrl()) {
                    throw new DeploymentException("No url supplied to resolve: " + name);
                }
                try {
                    //TODO expose jsr-77 objects for these guys
                    builder.bind(name, new URL(gerResourceRef.getUrl()));
                } catch (MalformedURLException e) {
                    throw  new DeploymentException("Could not convert " + gerResourceRef.getUrl() + " to URL", e);
                }
            } else {
                //determine jsr-77 type from interface
                String j2eeType;


                if ("javax.mail.Session".equals(type)) {
                    j2eeType = NameFactory.JAVA_MAIL_RESOURCE;
                } else if (JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
                    j2eeType = NameFactory.JAXR_CONNECTION_FACTORY;
                } else {
                    j2eeType = NameFactory.JCA_MANAGED_CONNECTION_FACTORY;
                }
                try {
                    String containerId = getResourceContainerId(name, j2eeType, moduleURI, gerResourceRef, earContext);

                    ref = refContext.getConnectionFactoryRef(containerId, iface);
                    builder.bind(name, ref);
                } catch (UnresolvedReferenceException e) {
                    throw new DeploymentException("Unable to resolve resource reference '" + name + "' (" + (e.isMultiple() ? "found multiple matching resources" : "no matching resources found") + ")");
                }
            }
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.