@SuppressWarnings("unchecked") @Override protected CMIReferenceable<T> getCMIReferenceable(final CMIReference cmiReference) throws Exception { return (CMIReferenceable<T>) clusterViewManager.getPool(objectName).get(cmiReference); }
@Override protected void checkInitialized() throws HAEJBInvocationHandlerException { try { synchronized(clusterViewManager){ // The first time, create a pool to share stubs for EJBHome if(clusterViewManager.getPool(objectName) == null) { LOGGER.debug("First lookup on {0}: creation of the pool for its stubs for EJBHome", objectName); Pool<CMIReferenceable<?>, CMIReference> pool = new JPool<CMIReferenceable<?>, CMIReference>( new StubOrProxyFactory(clusterViewManager)); IPoolConfiguration poolConfiguration = clusterViewManager.getPoolConfiguration(objectName); if(poolConfiguration != null) { pool.setPoolConfiguration(poolConfiguration); } clusterViewManager.setPool(objectName, pool); } } if(classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); } if(remoteClass == null) { remoteClass = clusterViewManager.getRemoteClass(objectName); } } catch (Exception e) { LOGGER.error("Cannot init the HA EJBHome proxy", e); throw new HAEJBInvocationHandlerException("Cannot init the HA EJBHome proxy", e); } }
@Override protected void checkInitialized() throws EJBInvocationHandlerException { try { synchronized(clusterViewManager){ // The first time, create a pool to share stubs for EJBObject if(clusterViewManager.getPool(objectName) == null) { logger.debug("First lookup on {0}: creation of the pool for its stubs for EJBObject", objectName); Pool<CMIReferenceable<?>, CMIReference> pool = new JPool<CMIReferenceable<?>, CMIReference>( new EJBObjectFactory(clusterViewManager)); IPoolConfiguration poolConfiguration = clusterViewManager.getPoolConfiguration(objectName); if(poolConfiguration != null) { pool.setPoolConfiguration(poolConfiguration); } clusterViewManager.setPool(objectName, pool); } } if(classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); } if(remoteClass == null) { remoteClass = clusterViewManager.getRemoteClass(objectName); } } catch(Exception e) { logger.error("Cannot init the EJBHome proxy", e); throw new EJBInvocationHandlerException("Cannot init the EJBHome proxy", e); } }
@Override protected void onFinallyHook(final String objectName, final CMIReferenceable<T> cmiReferenceable) { try { clusterViewManager.getPool(objectName).release(cmiReferenceable); } catch (Exception e) { logger.debug("Cannot release the reference {0}", cmiReferenceable, e); } }
@Override protected void checkInitialized() throws POJOInvocationHandlerException { try { synchronized(clusterViewManager){ // The first time, create a pool to share stubs for EJBHome if(clusterViewManager.getPool(objectName) == null) { LOGGER.debug("First lookup on {0}: creation of the pool for its stubs for EJBHome", objectName); Pool<CMIReferenceable<?>, CMIReference> pool = new JPool<CMIReferenceable<?>, CMIReference>( new StubOrProxyFactory(clusterViewManager)); IPoolConfiguration poolConfiguration = clusterViewManager.getPoolConfiguration(objectName); if(poolConfiguration != null) { pool.setPoolConfiguration(poolConfiguration); } clusterViewManager.setPool(objectName, pool); } } } catch (Exception e) { LOGGER.error("Cannot init the pool", e); throw new POJOInvocationHandlerException("Cannot init the pool", e); } if(classLoader == null) { try { classLoader = Thread.currentThread().getContextClassLoader(); } catch(Exception e) { throw new POJOInvocationHandlerException( "Cannot retrieve the classloader for object with name " + objectName, e); } } }
@Override protected void onExceptionHook(final String objectName, final CMIReferenceable<T> cmiReferenceable) throws Exception { try { clusterViewManager.getPool(objectName).discard(cmiReferenceable); } catch (Exception e) { logger.debug("Cannot discard the reference {0}", cmiReferenceable, e); } }
synchronized(clusterViewManager){ if(clusterViewManager.getPool(objectName) == null) { LOGGER.debug("First lookup on {0}: creation of the pool for its stubs for EJBObject", objectName); Pool<CMIReferenceable<?>, CMIReference> pool =
throws Throwable { try { clusterViewManager.getPool(objectName).discard(cmiReferenceable); } catch (Exception e) { logger.debug("Cannot discard the reference {0}", cmiReferenceable, e);
synchronized(clusterViewManager){ if(clusterViewManager.getPool(objectName) == null) { logger.debug("First lookup on {0}: creation of the pool for its stubs for EJBHome", objectName); Pool<CMIReferenceable<?>, CMIReference> pool =
synchronized(clusterViewManager){ if(clusterViewManager.getPool(objectName) == null) { LOGGER.debug("First lookup on {0}: creation of the pool for its stubs for EJBObject", objectName); Pool<CMIReferenceable<?>, CMIReference> pool = if(clusterViewManager.getPool(objectName) == null) { LOGGER.debug("First lookup on {0}: creation of the pool for its mandatories", objectName); Pool<CMIReferenceable<?>, CMIReference> pool = synchronized(clusterViewManager){ if(clusterViewManager.getPool(objectName) == null) { LOGGER.debug("First lookup on {0}: creation of the pool for its stubs for EJBHome", objectName); Pool<CMIReferenceable<?>, CMIReference> pool =