/** * Whether there is a local target * * @param invocation * @return true when in the registry */ public boolean hasLocalTarget(Invocation invocation) { return Registry.lookup(invocation.getObjectName()) != null; }
public MarshalledInvocation(Invocation invocation) { this.payload = invocation.payload; this.as_is_payload = invocation.as_is_payload; this.method = invocation.getMethod(); this.objectName = invocation.getObjectName(); this.args = invocation.getArguments(); this.invocationType = invocation.getType(); this.transient_payload = invocation.transient_payload; this.invocationContext = invocation.invocationContext; }
try mbean = (ObjectName) Registry.lookup(invocation.getObjectName());
/** Handle methods locally on the client * * @param mi * @return * @throws Throwable */ public Object invoke(Invocation mi) throws Throwable { Method m = mi.getMethod(); String methodName = m.getName(); HttpInvokerProxy proxy = (HttpInvokerProxy) mi.getInvocationContext().getInvoker(); // Implement local methods if( methodName.equals("toString") ) { return toString(proxy); } if( methodName.equals("equals") ) { Object[] args = mi.getArguments(); String thisString = toString(proxy); String argsString = args[0] == null ? "" : args[0].toString(); return new Boolean(thisString.equals(argsString)); } if( methodName.equals("hashCode") ) { return (Integer) mi.getObjectName(); } return getNext().invoke(mi); }
/** Handle methods locally on the client * * @param mi * @return the invocation response * @throws Throwable */ public Object invoke(Invocation mi) throws Throwable { Method m = mi.getMethod(); String methodName = m.getName(); InvokerProxyHA proxy = (InvokerProxyHA) mi.getInvocationContext().getInvoker(); // Implement local methods if( methodName.equals("toString") ) { return toString(proxy); } if( methodName.equals("equals") ) { Object[] args = mi.getArguments(); String thisString = toString(proxy); String argsString = args[0] == null ? "" : args[0].toString(); return new Boolean(thisString.equals(argsString)); } if( methodName.equals("hashCode") ) { return (Integer) mi.getObjectName(); } return getNext().invoke(mi); }
/** * Invoke a method. */ public Object invoke(Invocation invocation) throws Exception { ClassLoader oldCl = TCLAction.UTIL.getContextClassLoader(); ObjectName mbean = (ObjectName) Registry.lookup((Integer) invocation.getObjectName()); try { Object[] args = {invocation}; Object rtnValue = serverAction.invoke(mbean, "invoke", args, Invocation.INVOKE_SIGNATURE); return rtnValue; } catch (Exception e) { e = (Exception) JMXExceptionDecoder.decode(e); if (log.isTraceEnabled()) log.trace("Failed to invoke on mbean: " + mbean, e); throw e; } finally { TCLAction.UTIL.setContextClassLoader(oldCl); } }
invocation.setTransaction(tx); Integer nameHash = (Integer) invocation.getObjectName(); ObjectName mbean = (ObjectName) Registry.lookup(nameHash);
ObjectName mbean = (ObjectName) Registry.lookup(invocation.getObjectName()); long clientViewId = ((Long)invocation.getValue("CLUSTER_VIEW_ID")).longValue(); HATarget target = targetMap.get(invocation.getObjectName()); if (target == null)
try mbean = (ObjectName) Registry.lookup(invocation.getObjectName()); HATarget target = (HATarget) beanMap.get(invocation.getObjectName()); if(target == null)
log.trace("METHOD REMOTE INVOKE " + mi.getObjectName() + "||" + mi.getMethod().getName() + "||"); log.trace("METHOD HOME INVOKE " + mi.getObjectName() + "||" + mi.getMethod().getName() + "||" + mi.getArguments().toString());
invocation.getObjectName() + " calling method " + invocation.getMethod(), lastException); invocation.getObjectName() + " calling method " + invocation.getMethod(), lastException);