private static boolean isEJB30Ref(EjbReferenceDescriptor refDesc) { return refDesc.isEJB30ClientView(); }
public boolean isEjbReferenceCacheable(EjbReferenceDescriptor ejbRefDesc) { // Ejb-ref is only eligible for caching if it refers to the legacy // Home view and it is resolved to an ejb within the same application. return ( (!ejbRefDesc.isEJB30ClientView()) && (ejbRefDesc.getEjbDescriptor() != null) ); // caching not enabled. //return false; }
public boolean isEjbReferenceCacheable(EjbReferenceDescriptor ejbRefDesc) { // Ejb-ref is only eligible for caching if it refers to the legacy // Home view and it is resolved to an ejb within the same application. return ( (!ejbRefDesc.isEJB30ClientView()) && (ejbRefDesc.getEjbDescriptor() != null) ); // caching not enabled. //return false; }
@Override public void setInjectResourceType(String resourceType) { if (isEJB30ClientView()) { setEjbInterface(resourceType); } else { setEjbHomeInterface(resourceType); } }
public void setInjectResourceType(String resourceType) { if (isEJB30ClientView()) { setEjbInterface(resourceType); } else { setEjbHomeInterface(resourceType); } }
private String getRemoteEjbJndiName(EjbReferenceDescriptor refDesc) { String intf = refDesc.isEJB30ClientView() ? refDesc.getEjbInterface() : refDesc.getHomeClassName(); return getRemoteEjbJndiName(refDesc.isEJB30ClientView(), intf, refDesc.getJndiName()); }
@Override public String getInjectResourceType() { return isEJB30ClientView() ? getEjbInterface() : getEjbHomeInterface(); }
public String getInjectResourceType() { return isEJB30ClientView() ? getEjbInterface() : getEjbHomeInterface(); }
/** * Actual jndi-name under which Remote ejb factory lives depends on * whether it's a Remote Home view or Remote Business view. This is * necessary since a single session bean can expose both views and * the resulting factory objects are different. These semantics are * not exposed to the developer-view to keep things simpler. The * developer can simply deal with a single physical jndi-name. If the * target bean exposes both a Remote Home view and a Remote Business * view, the developer can still use the single physical jndi-name * to resolve remote ejb-refs, and we will handle the distinction * internally. Of course, this is based on the assumption that the * internal name is generated in a way that will not clash with a * separate top-level physical jndi-name chosen by the developer. * * Note that it's better to delay this final jndi name translation as * much as possible and do it right before the NamingManager lookup, * as opposed to changing the jndi-name within the descriptor objects * themselves. This way, the extra indirection will not be exposed * if the descriptors are written out and they won't complicate any * jndi-name equality logic. * */ public static String getRemoteEjbJndiName(EjbReferenceDescriptor refDesc) { String intf = refDesc.isEJB30ClientView() ? refDesc.getEjbInterface() : refDesc.getHomeClassName(); return getRemoteEjbJndiName(refDesc.isEJB30ClientView(), intf, refDesc.getJndiName()); }
/** * Actual jndi-name under which Remote ejb factory lives depends on * whether it's a Remote Home view or Remote Business view. This is * necessary since a single session bean can expose both views and * the resulting factory objects are different. These semantics are * not exposed to the developer-view to keep things simpler. The * developer can simply deal with a single physical jndi-name. If the * target bean exposes both a Remote Home view and a Remote Business * view, the developer can still use the single physical jndi-name * to resolve remote ejb-refs, and we will handle the distinction * internally. Of course, this is based on the assumption that the * internal name is generated in a way that will not clash with a * separate top-level physical jndi-name chosen by the developer. * * Note that it's better to delay this final jndi name translation as * much as possible and do it right before the NamingManager lookup, * as opposed to changing the jndi-name within the descriptor objects * themselves. This way, the extra indirection will not be exposed * if the descriptors are written out and they won't complicate any * jndi-name equality logic. * */ public static String getRemoteEjbJndiName(EjbReferenceDescriptor refDesc) { String intf = refDesc.isEJB30ClientView() ? refDesc.getEjbInterface() : refDesc.getHomeClassName(); return getRemoteEjbJndiName(refDesc.isEJB30ClientView(), intf, refDesc.getJndiName()); }
/** returns a formatted string representing me. */ public void print(StringBuffer toStringBuffer) { String localVsRemote = isLocal() ? "Local" : "Remote"; toStringBuffer.append(localVsRemote + " ejb-ref "); toStringBuffer.append("name="+getName()); if( isEJB30ClientView() ) { toStringBuffer.append("," + localVsRemote + " 3.x interface ="+getEjbInterface()); } else { toStringBuffer.append("," + localVsRemote + " 2.x home ="+getEjbHomeInterface()); toStringBuffer.append("," + localVsRemote + " 2.x component interface="+getEjbInterface()); } if( ejbDescriptor != null ) { toStringBuffer.append(" resolved to intra-app EJB "+ejbDescriptor.getName() + " in module " + ejbDescriptor.getEjbBundleDescriptor().getModuleName()); } toStringBuffer.append(",ejb-link="+getLinkName()); toStringBuffer.append(",lookup="+getLookupName()); toStringBuffer.append(",mappedName="+getMappedName()); toStringBuffer.append(",jndi-name=" + getValue()); toStringBuffer.append(",refType="+getType()); }
/** returns a formatted string representing me. */ @Override public void print(StringBuffer toStringBuffer) { String localVsRemote = isLocal() ? "Local" : "Remote"; toStringBuffer.append(localVsRemote + " ejb-ref "); toStringBuffer.append("name="+getName()); if( isEJB30ClientView() ) { toStringBuffer.append("," + localVsRemote + " 3.x interface ="+getEjbInterface()); } else { toStringBuffer.append("," + localVsRemote + " 2.x home ="+getEjbHomeInterface()); toStringBuffer.append("," + localVsRemote + " 2.x component interface="+getEjbInterface()); } if( ejbDescriptor != null ) { toStringBuffer.append(" resolved to intra-app EJB "+ejbDescriptor.getName() + " in module " + ejbDescriptor.getEjbBundleDescriptor().getModuleName()); } toStringBuffer.append(",ejb-link="+getLinkName()); toStringBuffer.append(",lookup="+getLookupName()); toStringBuffer.append(",mappedName="+getMappedName()); toStringBuffer.append(",jndi-name=" + getValue()); toStringBuffer.append(",refType="+getType()); }
String refInterface = ejbRefDesc.isEJB30ClientView() ? ejbRefDesc.getEjbInterface() : ejbRefDesc.getHomeClassName(); origClassLoader.loadClass(refInterface);
public static Object resolveEjbRefObject(EjbReferenceDescriptor refDesc, Object jndiObj) throws NamingException { Object returnObject = jndiObj; if( refDesc.isLocal() ) { EjbDescriptor target = refDesc.getEjbDescriptor(); BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(target.getUniqueId()); if( refDesc.isEJB30ClientView() ) { GenericEJBLocalHome genericLocalHome = container.getEJBLocalBusinessHome(refDesc.getEjbInterface()); returnObject = genericLocalHome.create(refDesc.getEjbInterface()); } else { returnObject = container.getEJBLocalHome(); } } else { // For the Remote case, the only time we have to do // something extra with the given jndiObj is if the lookup // is for a Remote 3.0 object and it was made through a // corba interoperable name. In that case, // the jndiObj refers to the internal Remote 3.0 Home so we // still need to create a remote 30 client wrapper object. if ( refDesc.isEJB30ClientView() && !(jndiObj instanceof RemoteBusinessWrapperBase) ) { returnObject = EJBUtils.lookupRemote30BusinessObject (jndiObj, refDesc.getEjbInterface()); } } return returnObject; }
public static Object resolveEjbRefObject(EjbReferenceDescriptor refDesc, Object jndiObj) throws NamingException { Object returnObject = jndiObj; if( refDesc.isLocal() ) { EjbDescriptor target = refDesc.getEjbDescriptor(); BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(target.getUniqueId()); if( refDesc.isEJB30ClientView() ) { GenericEJBLocalHome genericLocalHome = container.getEJBLocalBusinessHome(refDesc.getEjbInterface()); returnObject = genericLocalHome.create(refDesc.getEjbInterface()); } else { returnObject = container.getEJBLocalHome(); } } else { // For the Remote case, the only time we have to do // something extra with the given jndiObj is if the lookup // is for a Remote 3.0 object and it was made through a // corba interoperable name. In that case, // the jndiObj refers to the internal Remote 3.0 Home so we // still need to create a remote 30 client wrapper object. if ( refDesc.isEJB30ClientView() && !(jndiObj instanceof RemoteBusinessWrapperBase) ) { returnObject = EJBUtils.lookupRemote30BusinessObject (jndiObj, refDesc.getEjbInterface()); } } return returnObject; }
String refInterface = ejbRefDesc.isEJB30ClientView() ? ejbRefDesc.getEjbInterface() : ejbRefDesc.getHomeClassName(); origClassLoader.loadClass(refInterface);