public T getTarget() { return cmiReferenceable.getReferencedObject(); }
public Object proceed() throws Exception { return method.invoke(cmiReferenceable.getReferencedObject(), parameters); }
/** * Creates an instance of CMIReferenceable with the given hint. * @param cmiReference a clue given by the Pool. Could be null. * @throws PoolException if instance cannot be created. * @return the created instance. */ public CMIReferenceable<?> create(final CMIReference cmiReference) throws PoolException { CMIReferenceable<?> stubOrProxy; try { stubOrProxy = StubOrProxyHelper.download(clusterViewManager, cmiReference); } catch (ProtocolNotFoundException e) { LOGGER.error("Cannot get a CMIReferenceable for " + cmiReference, e); throw new PoolException("Cannot get a CMIReferenceable for " + cmiReference, e); } catch (ObjectNotFoundException e) { LOGGER.error("Cannot get a CMIReferenceable for " + cmiReference, e); throw new PoolException("Cannot get a CMIReferenceable for " + cmiReference, e); } catch (NamingException e) { LOGGER.debug("No CMIReferenceable is bound for " + cmiReference, e); throw new NamingPoolException( "No CMIReferenceable is bound for " + cmiReference, e); } if (expectedType != null && !expectedType.isAssignableFrom(stubOrProxy.getReferencedObject().getClass())) { LOGGER.error("Unexpected type! Required: {0} - Found: {1}", expectedType.getName(), stubOrProxy.getReferencedObject().getClass().getName()); throw new PoolException("Unexpected type! Required: " + expectedType.getName() + " - Found: " + stubOrProxy.getReferencedObject().getClass().getName()); } LOGGER.debug("Adding a new stub/proxy for {0}: {1}", cmiReference, stubOrProxy); return stubOrProxy; }
arguments = new Object[] {remoteStubWrapped.getReferencedObject().getPrimaryKey()};
long timeBefore = System.currentTimeMillis(); try { result = method.invoke(cmiReferenceable.getReferencedObject(), args); long timeAfter = System.currentTimeMillis(); lastInvocDuration = timeAfter - timeBefore;