private void addSpecialCompBindings(final Map<String, Object> bindings) { // bind TransactionManager final TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class); bindings.put("comp/TransactionManager", transactionManager); // bind TransactionSynchronizationRegistry bindings.put("comp/TransactionSynchronizationRegistry", new TransactionSynchronizationRegistryWrapper()); bindings.put("comp/ORB", new SystemComponentReference(ORB.class)); bindings.put("comp/HandleDelegate", new SystemComponentReference(HandleDelegate.class)); // bind bean validation objects bindings.put("comp/ValidatorFactory", new IntraVmJndiReference(Assembler.VALIDATOR_FACTORY_NAMING_CONTEXT + uniqueId)); bindings.put("comp/Validator", new IntraVmJndiReference(Assembler.VALIDATOR_NAMING_CONTEXT + uniqueId)); // bind UserTransaction if bean managed transactions if (beanManagedTransactions) { final UserTransaction userTransaction = new CoreUserTransaction(transactionManager); bindings.put("comp/UserTransaction", userTransaction); } }
public Object getObject() throws javax.naming.NamingException { Object o = super.getObject(); try { o = copy(o); } catch (final Exception e) { throw new NamingException("Error copying object into local class loader", e); } return o; }
public Object getObject() throws NamingException { final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); try { return containerSystem.getJNDIContext().lookup(jndiName); } catch (final NameNotFoundException e) { // EE.5.18: try using java:module/<shortName> prefix return containerSystem.getJNDIContext().lookup("java:module/" + Strings.lastPart(getClassName(), '.')); } catch (final NamingException e) { throw (NamingException) new NamingException("could not look up " + jndiName).initCause(e); } }
private Object createClientRef(Object value) { if (value instanceof IntraVmJndiReference) { IntraVmJndiReference intraVmJndiReference = (IntraVmJndiReference) value; String deploymentId = intraVmJndiReference.getJndiName(); if (deploymentId.startsWith("java:openejb/local/")) { deploymentId = deploymentId.substring("java:openejb/local/".length()); } if (deploymentId.startsWith("java:openejb/remote/")) { deploymentId = deploymentId.substring("java:openejb/remote/".length()); } if (deploymentId.startsWith("java:openejb/Deployment/")) { deploymentId = deploymentId.substring("java:openejb/Deployment/".length()); } ClientEjbReference clientRef = new ClientEjbReference(uri.toString(), deploymentId); return clientRef; } return value; }
private void addSpecialCompBindings(final Map<String, Object> bindings) { // bind TransactionManager final TransactionManager transactionManager = SystemInstance.get().getComponent(TransactionManager.class); bindings.put("comp/TransactionManager", transactionManager); // bind TransactionSynchronizationRegistry bindings.put("comp/TransactionSynchronizationRegistry", new TransactionSynchronizationRegistryWrapper()); try { bindings.put("comp/ORB", new SystemComponentReference(ParentClassLoaderFinder.Helper.get().loadClass("org.omg.CORBA.ORB"))); } catch (final NoClassDefFoundError | ClassNotFoundException e) { // no corba, who does recall what it is today anyway :D } bindings.put("comp/HandleDelegate", new SystemComponentReference(HandleDelegate.class)); // bind bean validation objects bindings.put("comp/ValidatorFactory", new IntraVmJndiReference(Assembler.VALIDATOR_FACTORY_NAMING_CONTEXT + uniqueId)); bindings.put("comp/Validator", new IntraVmJndiReference(Assembler.VALIDATOR_NAMING_CONTEXT + uniqueId)); // bind UserTransaction if bean managed transactions if (beanManagedTransactions) { final UserTransaction userTransaction = new CoreUserTransaction(transactionManager); bindings.put("comp/UserTransaction", userTransaction); } }
public Object getObject() throws javax.naming.NamingException { Object o = super.getObject(); try { o = copy(o); } catch (final Exception e) { throw new NamingException("Error copying object into local class loader", e); } return o; }
public Object getObject() throws NamingException { final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); try { return containerSystem.getJNDIContext().lookup(jndiName); } catch (final NameNotFoundException e) { // EE.5.18: try using java:module/<shortName> prefix return containerSystem.getJNDIContext().lookup("java:module/" + Strings.lastPart(getClassName(), '.')); } catch (final NamingException e) { throw (NamingException) new NamingException("could not look up " + jndiName).initCause(e); } }
Reference ref = new IntraVmJndiReference(name); count ++; singleRef = ref; Reference ref = new IntraVmJndiReference(name); count++; singleRef = ref; Reference ref = new IntraVmJndiReference(name); count++; singleRef = ref; Reference ref = new IntraVmJndiReference(name); count++; singleRef = ref; Reference ref = new IntraVmJndiReference(name); count ++; singleRef = ref;
public Object getObject() throws javax.naming.NamingException { Object o = super.getObject(); try { o = copy(o); } catch (Exception e) { throw new NamingException("Error copying object into local class loader", e); } return o; }
reference = new CrossClassLoaderJndiReference(jndiName); } else { reference = new IntraVmJndiReference(jndiName); } else { String jndiName = "openejb/Deployment/" + JndiBuilder.format(referenceInfo.ejbDeploymentId, referenceInfo.interfaceClassName, referenceInfo.localbean ? InterfaceType.LOCALBEAN : InterfaceType.BUSINESS_LOCAL); reference = new IntraVmJndiReference(jndiName); } else if (referenceInfo.resourceID != null) { String jndiName = "openejb/Resource/" + referenceInfo.resourceID; reference = new IntraVmJndiReference(jndiName); } else { String jndiName = "openejb/Resource/" + referenceInfo.referenceName; reference = new IntraVmJndiReference(jndiName); } else if (referenceInfo.resourceID != null) { String jndiName = "openejb/Resource/" + referenceInfo.resourceID; reference = new IntraVmJndiReference(jndiName); } else { String jndiName = "openejb/Resource/" + referenceInfo.resourceEnvRefName; reference = new IntraVmJndiReference(jndiName); Reference reference = new IntraVmJndiReference(jndiName); bindings.put(normalize(referenceInfo.referenceName), reference);
reference = new CrossClassLoaderJndiReference(jndiName); } else { reference = new IntraVmJndiReference(jndiName); } else { final String jndiName = "openejb/Deployment/" + JndiBuilder.format(referenceInfo.ejbDeploymentId, referenceInfo.interfaceClassName, referenceInfo.localbean ? InterfaceType.LOCALBEAN : InterfaceType.BUSINESS_LOCAL); reference = new IntraVmJndiReference(jndiName); } else if (referenceInfo.resourceID != null) { final String jndiName = "openejb/Resource/" + referenceInfo.resourceID; reference = new IntraVmJndiReference(jndiName); } else { final String jndiName = "openejb/Resource/" + referenceInfo.referenceName; reference = new IntraVmJndiReference(jndiName); reference = new IntraVmJndiReference("comp/UserTransaction"); } else if (referenceInfo.resourceID != null) { final String jndiName = "openejb/Resource/" + referenceInfo.resourceID; reference = new IntraVmJndiReference(jndiName); } else { final String jndiName = "openejb/Resource/" + referenceInfo.referenceName; reference = new IntraVmJndiReference(jndiName); final Reference reference = new IntraVmJndiReference(jndiName); bindings.put(normalize(referenceInfo.referenceName), reference); if (jndiName != null && !jndiName.isEmpty() && isNotGobalOrIsHoldByThisApp(resource, scope)) { final String refName = "openejb/Resource/" + resource.id; final Object reference = new IntraVmJndiReference(refName);
reference = new CrossClassLoaderJndiReference(jndiName); } else { reference = new IntraVmJndiReference(jndiName); } else { final String jndiName = "openejb/Deployment/" + JndiBuilder.format(referenceInfo.ejbDeploymentId, referenceInfo.interfaceClassName, referenceInfo.localbean ? InterfaceType.LOCALBEAN : InterfaceType.BUSINESS_LOCAL); reference = new IntraVmJndiReference(jndiName); } else if (referenceInfo.resourceID != null) { final String jndiName = "openejb/Resource/" + referenceInfo.resourceID; reference = new IntraVmJndiReference(jndiName); } else { final String jndiName = "openejb/Resource/" + referenceInfo.referenceName; reference = new IntraVmJndiReference(jndiName); reference = new IntraVmJndiReference("comp/UserTransaction"); } else if (referenceInfo.resourceID != null) { final String jndiName = "openejb/Resource/" + referenceInfo.resourceID; reference = new IntraVmJndiReference(jndiName); } else { final String jndiName = "openejb/Resource/" + referenceInfo.referenceName; reference = new IntraVmJndiReference(jndiName); final Reference reference = new IntraVmJndiReference(jndiName); bindings.put(normalize(referenceInfo.referenceName), reference); if (jndiName != null && !jndiName.isEmpty() && isNotGobalOrIsHoldByThisApp(resource, scope)) { final String refName = "openejb/Resource/" + resource.id; final Object reference = new IntraVmJndiReference(refName);
Reference reference = new IntraVmJndiReference(jndiName);
final Reference reference = new IntraVmJndiReference(jndiName);
final Reference reference = new IntraVmJndiReference(jndiName);
reference = new CrossClassLoaderJndiReference(jndiName); } else { reference = new IntraVmJndiReference(jndiName);
reference = new CrossClassLoaderJndiReference(jndiName); } else { reference = new IntraVmJndiReference(jndiName);
reference = new CrossClassLoaderJndiReference(jndiName); } else { reference = new IntraVmJndiReference(jndiName);