protected void checkFailoverNeed (Invocation mi) throws GenericClusteringException { Object data = mi.getValue ("DO_FAIL_DURING_NEXT_CALL"); if (data != null && data instanceof java.lang.Boolean && data.equals (java.lang.Boolean.TRUE)) { // we now determine if we have already failed // Object alreadyDone = mi.getValue ("FAILOVER_COUNTER"); if (alreadyDone != null && alreadyDone instanceof java.lang.Integer && ((java.lang.Integer)alreadyDone).intValue () == 0) { // we do fail // this.log.debug ("WE FAILOVER IN SERVER INTERCEPTOR (explicit failover asked by client interceptor)!"); throw new GenericClusteringException (GenericClusteringException.COMPLETED_NO, "Test failover from server interceptor", false); } } }
Long clientViewId = (Long) invocation.getValue("CLUSTER_VIEW_ID"); HARMIResponse rsp = new HARMIResponse(); if (clientViewId.longValue() != target.getCurrentViewId())
/** A Marshalled invocation has serialized data in the form of MarshalledValue objects. We overwrite the "getValue" to deserialize the data, this assume that the thread context class loader has visibility on the classes. */ public Object getValue(Object key) { Object value = super.getValue(key); // The map may contain serialized values of the fields if (value instanceof IMarshalledValue) { try { IMarshalledValue mv = (IMarshalledValue) value; value = mv.get(); } catch (Exception e) { JBossLazyUnmarshallingException ise = new JBossLazyUnmarshallingException("getValue failed"); ise.initCause(e); throw ise; } } return value; }
public Object invoke (Invocation mi) throws Throwable { Object data = mi.getValue ("DO_FAIL_DURING_NEXT_CALL"); if (data != null && data instanceof java.lang.Boolean && data.equals (java.lang.Boolean.TRUE)) { // Clear the instruction mi.setValue ("DO_FAIL_DURING_NEXT_CALL", Boolean.FALSE, PayloadKey.AS_IS); if (proxyFamilyName == null) { proxyFamilyName = getProxyFamilyName(mi); } // Clear the targets to simulate exhausting them all FamilyClusterInfo info = ClusteringTargetsRepository.getFamilyClusterInfo(proxyFamilyName); for (Object target: info.getTargets()) info.removeDeadTarget(target); throw new ServiceUnavailableException("Service unavailable", new Exception("Test")); } return getNext().invoke(mi); }
long clientViewId = ((Long)invocation.getValue("CLUSTER_VIEW_ID")).longValue();
ObjectName objectName = (ObjectName) invocation.getValue("JMX_OBJECT_NAME"); if (objectName != null)
long clientViewId = ((Long) invocation.getValue("CLUSTER_VIEW_ID")).longValue(); HATarget target = (HATarget) beanMap.get(invocation.getObjectName()); if(target == null)
throws SSLPeerUnverifiedException String sessionID = (String) mi.getValue(sessionIDKey); if( sessionID != null )
Object msgContext = mi.getValue(InvocationKey.SOAP_MESSAGE_CONTEXT);