Examples of ORB


Examples of org.omg.CORBA.ORB

            } else {
                name = component.getComponentName();
            }
            name = name.replace(".", "_");

            final ORB orb = this.orb.getValue();
            if (interfaceRepositorySupported) {
                // Create a CORBA interface repository for the enterprise bean
                iri = new InterfaceRepository(orb, irPoa.getValue(), name);
                // Add bean interface info to the interface repository
                iri.mapClass(remoteView.getValue().getViewClass());
                iri.mapClass(homeView.getValue().getViewClass());
                iri.finishBuild();
                EjbLogger.ROOT_LOGGER.cobraInterfaceRepository(name, orb.object_to_string(iri.getReference()));
            }

            IORSecurityConfigMetaData iorSecurityConfigMetaData = null;
            if (this.iiopMetaData != null)
                iorSecurityConfigMetaData = this.iiopMetaData.getIorSecurityConfigMetaData();

            // Create security policies if security metadata has been provided.
            List<Policy> policyList = new ArrayList<Policy>();
            if (iorSecurityConfigMetaData != null) {

                // Create csiv2Policy for both home and remote containing IorSecurityConfigMetadata.
                final Any secPolicy = orb.create_any();
                secPolicy.insert_Value(iorSecurityConfigMetaData);
                Policy csiv2Policy = orb.create_policy(CSIv2Policy.TYPE, secPolicy);
                policyList.add(csiv2Policy);

                // Create SSLPolicy (SSL_REQUIRED ensures home and remote IORs will have port 0 in the primary address).
                boolean sslRequired = false;
                if (iorSecurityConfigMetaData != null) {
                    IORTransportConfigMetaData tc = iorSecurityConfigMetaData.getTransportConfig();
                    sslRequired = IORTransportConfigMetaData.INTEGRITY_REQUIRED.equals(tc.getIntegrity())
                            || IORTransportConfigMetaData.CONFIDENTIALITY_REQUIRED.equals(tc.getConfidentiality())
                            || IORTransportConfigMetaData.ESTABLISH_TRUST_IN_CLIENT_REQUIRED.equals(tc.getEstablishTrustInClient());
                }
                final Any sslPolicyValue = orb.create_any();
                SSLPolicyValueHelper.insert(sslPolicyValue, (sslRequired) ? SSLPolicyValue.SSL_REQUIRED : SSLPolicyValue.SSL_NOT_REQUIRED);
                Policy sslPolicy = orb.create_policy(SSL_POLICY_TYPE.value, sslPolicyValue);
                policyList.add(sslPolicy);

                EjbLogger.ROOT_LOGGER.debug("container's SSL policy: " + sslPolicy);
            }

            String securityDomain = "CORBA_REMOTE"; //TODO: what should this default to
            if (component.getSecurityMetaData() != null) {
                securityDomain = component.getSecurityMetaData().getSecurityDomain();
            }

            Policy[] policies = policyList.toArray(new Policy[policyList.size()]);

            // If there is an interface repository, then get the homeInterfaceDef from the IR
            InterfaceDef homeInterfaceDef = null;
            if (iri != null) {
                Repository ir = iri.getReference();
                homeInterfaceDef = InterfaceDefHelper.narrow(ir.lookup_id(homeRepositoryIds[0]));
            }

            // Get the POACurrent object
            Current poaCurrent = CurrentHelper.narrow(orb.resolve_initial_references("POACurrent"));

            // Instantiate home servant, bind it to the servant registry, and create CORBA reference to the EJBHome.
            final EjbCorbaServant homeServant = new EjbCorbaServant(poaCurrent, homeMethodMap, homeRepositoryIds, homeInterfaceDef,
                    orb, homeView.getValue(), factory, configuration, component.getTransactionManager(), module.getClassLoader(), true, securityDomain);

            homeServantRegistry = poaRegistry.getValue().getRegistryWithPersistentPOAPerServant();
            ReferenceFactory homeReferenceFactory = homeServantRegistry.bind(homeServantName(name), homeServant, policies);

            final org.omg.CORBA.Object corbaRef = homeReferenceFactory.createReference(homeRepositoryIds[0]);

            //we do this twice to force eager dynamic stub creation
            ejbHome = (EJBHome) PortableRemoteObject.narrow(corbaRef, EJBHome.class);

            final HomeHandleImplIIOP homeHandle = new HomeHandleImplIIOP(orb.object_to_string(corbaRef));
            homeServant.setHomeHandle(homeHandle);

            // Initialize beanPOA and create metadata depending on the kind of bean
            if (component instanceof EntityBeanComponent) {
View Full Code Here

Examples of org.omg.CORBA.ORB

                objectImpl._get_delegate();
            } catch (BAD_OPERATION e) {
                try {
                    // Reconnect
                    final Stub stub = (Stub) object;
                    final ORB orb = (ORB) new InitialContext().lookup("java:comp/ORB");
                    stub.connect(orb);
                } catch (NamingException ne) {
                    throw MESSAGES.failedToLookupORB();
                }
            }
View Full Code Here

Examples of org.omg.CORBA.ORB

               currentThread.setContextClassLoader(webLoader.getClassLoader());
               metaData.setENCLoader(webLoader.getClassLoader());
               InitialContext iniCtx = new InitialContext();
               Context envCtx = (Context)iniCtx.lookup("java:comp");
               // Add ORB/UserTransaction
               ORB orb = null;
               try
               {
                  ObjectName ORB_NAME = new ObjectName("jboss:service=CorbaORB");
                  orb = (ORB)server.getAttribute(ORB_NAME, "ORB");
                  // Bind the orb
View Full Code Here

Examples of org.omg.CORBA.ORB

                        } catch (Exception e) {
                        } // keep going
                    }

                    // Get ORB
                    ORB orb = CorbaUtils.getOrb(addr.host, addr.port, env);
                    //orbTracker = new org.jboss.as.jacorb.naming.jndi.OrbReuseTracker(orb);

                    // Assign to fields
                    setOrbAndRootContext(orb, (String) null);
                    return parsedUrl.getStringName();
View Full Code Here

Examples of org.omg.CORBA.ORB

        if (so == null) {
            // The Servant is not local any more
            return invokeRemoteCORBACall(stub, methodName, args);
        }
        Object[] newArgs = null;
        ORB orb = stub._orb();
        try {
            if (args != null)
                newArgs = Util.copyObjects(args, orb);
            JavaReflectionAdapter reflectionAdapter =
                JavaReflectionAdapter.createJavaReflectionAdapter(so.servant.getClass());
View Full Code Here

Examples of org.omg.CORBA_2_3.ORB

    private void processOperations(AxisService axisService,
                                        AxisConfiguration axisConfig,
                                        ArrayList excludeOperations,
                                        ArrayList nonRpcMethods, String dirName) throws Exception {
        ORB orb = CorbaUtil.getORB(axisService);
        IDL idl = CorbaUtil.getIDL(axisService, orb, dirName);

        Parameter orbParam = new Parameter(ORB_LITERAL, orb);
        Parameter idlParam = new Parameter(IDL_LITERAL, idl);
        axisService.addParameter(orbParam);
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.