public Object getBinding() { if (myObject != null && !(myObject instanceof Federation)) { return myObject;// if NameNode has an object it must be a binding } else { if (myContext == null) { myContext = new IvmContext(this); } return myContext; } }
public void close() throws NamingException { checkReadOnly(); }
String str4 = "root/comp/env/rate/work/doc/lot/break/story"; IvmContext context = new IvmContext(); context.bind(str1, new Integer(1)); context.bind(str2, new Integer(2)); context.bind(str4, new Integer(3)); Context subcntx = (Context) context.lookup(str3); org.apache.openejb.core.ivm.IntraVmCopyMonitor x = null; java.io.FileOutputStream fos = new java.io.FileOutputStream("x.ser");
public Context createComponentContext(Map<String, Object> bindings) throws SystemException { IvmContext context = new IvmContext(); try { context.bind("java:comp/env/dummy", "dummy"); } catch (javax.naming.NamingException e) { throw new org.apache.openejb.SystemException("Unable to create subcontext 'java:comp/env'. Exception:"+e.getMessage(),e); } for (Map.Entry<String, Object> entry: bindings.entrySet()) { String name = entry.getKey(); Object value = entry.getValue(); if (value == null) continue; try { context.bind(name, value); } catch (javax.naming.NamingException e) { throw new org.apache.openejb.SystemException("Unable to bind '" + name + "' into bean's enc.", e); } } return context; }
public void unbind(String name) throws NamingException { if(checkReadOnly()) { return; } final int indx = name.indexOf(":"); if (indx > -1) { /* The ':' character will be in the path if its an absolute path name starting with the schema 'java:'. We strip the schema off the path before passing it to the node.resolve method. */ name = name.substring(indx + 1); } fastCache.clear(); mynode.clearCache(); mynode.unbind(getParsedNameFor(name)); }
public String composeName(String name, String prefix) throws NamingException { Name result = composeName(new CompositeName(name), new CompositeName(prefix)); return result.toString(); }
public IvmJndiFactory() { jndiRootContext = IvmContext.createRootContext(); }
public NameParser getNameParser(final Name name) throws NamingException { return getNameParser(name.toString()); }
public void destroySubcontext(final Name name) throws NamingException { destroySubcontext(name.toString()); }
public void bind(final Name name, final Object obj) throws NamingException { bind(name.toString(), obj); }
public Context createSubcontext(final Name name) throws NamingException { return createSubcontext(name.toString()); }
protected Object federate(String compositName) throws NamingException { ObjectFactory factories [] = getFederatedFactories(); for (ObjectFactory factory : factories) { try { CompositeName name = new CompositeName(compositName); Object obj = factory.getObjectInstance(null, name, null, null); if (obj instanceof Context) return ((Context) obj).lookup(compositName); else if (obj != null) return obj; } catch (Exception doNothing) { } } throw new javax.naming.NameNotFoundException("Name \"" + compositName + "\" not found."); }
public Context createComponentContext(final Map<String, Object> bindings) throws SystemException { final IvmContext context = new IvmContext(); try { context.bind("java:comp/env/dummy", "dummy"); } catch (final NamingException e) { throw new SystemException("Unable to create subcontext 'java:comp/env'. Exception:" + e.getMessage(), e); } for (final Map.Entry<String, Object> entry : bindings.entrySet()) { final String name = entry.getKey(); final Object value = entry.getValue(); if (value == null) { continue; } try { context.bind(name, value); } catch (final NamingException e) { throw new SystemException("Unable to bind '" + name + "' into bean's enc.", e); } } return context; }
public void bind(String name, final Object obj) throws NamingException { if(checkReadOnly()) { return; } final int indx = name.indexOf(":"); if (indx > -1) { /* The ':' character will be in the path if its an absolute path name starting with the schema 'java:'. We strip the schema off the path before passing it to the node.resolve method. */ name = name.substring(indx + 1); } if (fastCache.containsKey(name)) { throw new NameAlreadyBoundException(); } else { final ParsedName parsedName = getParsedNameFor(name); mynode.bind(parsedName, obj); } }
public String composeName(final String name, final String prefix) throws NamingException { final Name result = composeName(new CompositeName(name), new CompositeName(prefix)); return result.toString(); }
public IvmJndiFactory() { jndiRootContext = IvmContext.createRootContext(); try { jndiRootContext.bind("openejb/local/.", ""); jndiRootContext.bind("openejb/remote/.", ""); jndiRootContext.bind("openejb/client/.", ""); jndiRootContext.bind("openejb/Deployment/.", ""); jndiRootContext.bind("openejb/global/.", ""); } catch (final NamingException e) { throw new OpenEJBRuntimeException("this should not happen", e); } }
public NameParser getNameParser(Name name) throws NamingException { return getNameParser(name.toString()); }