protected String buildJndiName(Reference reference) throws NamingException { // get and verify interface type String resourceId = getProperty(reference, RESOURCE_ID); if (resourceId == null) { resourceId = getProperty(reference, NAME); } if (resourceId == null) throw new NamingException("Resource reference id is null"); // build jndi name using the deploymentId and interface type String jndiName = "java:openejb/Resource/" + resourceId; return jndiName; }
@SuppressWarnings({"unchecked"}) public static <T> T getStaticValue(Reference ref, String name) { name = name != null ? "-" + name : ""; String token = getProperty(ref, "static-token" + name); if (token == null) { return null; } T object = (T) registry.get(token); return object; }
protected String buildJndiName(Reference reference) throws NamingException { String jndiName;// get and verify deploymentId String deploymentId = getProperty(reference, DEPLOYMENT_ID); if (deploymentId == null) throw new NamingException("ejb-ref deploymentId is null"); // get and verify interface type InterfaceType type = InterfaceType.BUSINESS_REMOTE; String interfaceType = getProperty(reference, REMOTE); if (interfaceType == null) { type = InterfaceType.BUSINESS_LOCAL; interfaceType = getProperty(reference, LOCAL); } if (interfaceType == null) throw new NamingException("ejb-ref interface type is null"); // build jndi name using the deploymentId and interface type jndiName = "java:openejb/Deployment/" + JndiBuilder.format(deploymentId, interfaceType, type); return jndiName; }
public Object getObjectInstance(Object object, Name name, Context context, Hashtable environment) throws Exception { Reference ref = (Reference) object; // the jndi context to use for the lookup (usually null which is the default context) String jndiProviderId = getProperty(ref, JNDI_PROVIDER_ID); // the jndi name String jndiName = getProperty(ref, JNDI_NAME); if (jndiName == null) { jndiName = buildJndiName(ref); } // look up the reference Object value = lookup(jndiProviderId, jndiName); return value; }
public Object getObjectInstance(Object object, Name name, Context context, Hashtable environment) throws Exception { Reference reference = ((Reference) object); if (reference.getClassName().equals("java.net.URL")) { String resourceId = getProperty(reference, RESOURCE_ID); return new URL(resourceId); } return super.getObjectInstance(object, name, context, environment); }
public Object getObjectInstance(Object object, Name name, Context context, Hashtable environment) throws Exception { // ignore non resource-refs if (!(object instanceof ResourceRef)) { return null; } Reference ref = (Reference) object; Object value; if (getProperty(ref, JNDI_NAME) != null) { // lookup the value in JNDI value = super.getObjectInstance(object, name, context, environment); } else { // value is hard hard coded in the properties value = getStaticValue(ref); } return value; }
public Object getObjectInstance(Object object, Name name, Context context, Hashtable environment) throws Exception { // ignore non resource-refs if (!(object instanceof ResourceRef)) { return null; } Reference ref = (Reference) object; Object value; if (getProperty(ref, JNDI_NAME) != null) { // lookup the value in JNDI value = super.getObjectInstance(object, name, context, environment); } else { // value is hard hard coded in the properties value = getStaticValue(ref); } return value; }
if (getProperty(ref, JNDI_NAME) != null) { String serviceClassName = getProperty(ref, WS_CLASS); Class<? extends Service> serviceClass = Service.class; if (serviceClassName != null) { String serviceId = getProperty(ref, WS_ID); if (getProperty(ref, WS_QNAME) != null) { serviceQName = QName.valueOf(getProperty(ref, WS_QNAME)); if (getProperty(ref, WSDL_URL) != null) { wsdlUrl = new URL(getProperty(ref, WSDL_URL)); if (getProperty(ref, WS_PORT_QNAME) != null) { portQName = QName.valueOf(getProperty(ref, WS_PORT_QNAME));
public Object getObjectInstance(Object object, Name name, Context context, Hashtable environment) throws Exception { Reference ref = (Reference) object; // load the component type class String className = getProperty(ref, COMPONENT_TYPE); Class<?> clazz = loadClass(className); if (clazz == null) return null; // lookup the value Object value = SystemInstance.get().getComponent(clazz); return value; } }