@ManagedOperation public void shutdown() { manager.shutdown(); }
public void clientCreated(Client client) { RMManager.this.clientCreated(client); } public void clientDestroyed(Client client) {
public void clientDestroyed(Client client) { RMManager.this.clientDestroyed(client); } });
/** * @param rma The rmAssertion to set. */ public void setRMAssertion(org.apache.cxf.ws.rmp.v200502.RMAssertion rma) { setConfiguration(RMPolicyUtilities.intersect(rma, getConfiguration())); }
@ManagedOperation public String[] getEndpointIdentifiers() { Set<String> identifiers = new HashSet<>(); for (Endpoint ep : manager.getReliableEndpointsMap().keySet()) { identifiers.add(RMUtils.getEndpointIdentifier(ep, manager.getBus())); } return identifiers.toArray(new String[0]); }
public void clientCreated(final Client client) { if (null == store || null == retransmissionQueue) { return; } String id = RMUtils.getEndpointIdentifier(client.getEndpoint(), getBus()); Collection<SourceSequence> sss = store.getSourceSequences(id/*, protocol*/); if (null == sss || 0 == sss.size()) { return; } LOG.log(Level.FINE, "Number of source sequences: {0}", sss.size()); recoverReliableEndpoint(client.getEndpoint(), client.getConduit()/*, protocol*/); }
manager.setRMAssertion(rmAssertion); manager.setDeliveryAssurance(deliveryAssurance); manager.setSourcePolicy(sourcePolicy); manager.setDestinationPolicy(destinationPolicy); manager.setStore(store); manager.getConfiguration().setRMNamespace(rmNamespace); manager.getConfiguration().setRM10AddressingNamespace(rm10AddressingNamespace.getUri());
void recoverReliableEndpoint(Endpoint endpoint, Conduit conduit) { if (null == store || null == retransmissionQueue) { return; } String id = RMUtils.getEndpointIdentifier(endpoint, getBus()); Collection<SourceSequence> sss = store.getSourceSequences(id); Collection<DestinationSequence> dss = store.getDestinationSequences(id); if ((null == sss || 0 == sss.size()) && (null == dss || 0 == dss.size())) { return; } LOG.log(Level.FINE, "Number of source sequences: {0}", sss.size()); LOG.log(Level.FINE, "Number of destination sequences: {0}", dss.size()); LOG.log(Level.FINE, "Recovering {0} endpoint with id: {1}", new Object[] {null == conduit ? "client" : "server", id}); RMEndpoint rme = createReliableEndpoint(endpoint); rme.initialise(getConfiguration(), conduit, null, null, null); synchronized (reliableEndpoints) { reliableEndpoints.put(endpoint, rme); } for (SourceSequence ss : sss) { recoverSourceSequence(endpoint, conduit, rme.getSource(), ss); } for (DestinationSequence ds : dss) { recoverDestinationSequence(endpoint, conduit, rme.getDestination(), ds); } retransmissionQueue.start(); redeliveryQueue.start(); }
Source source = getManager().getSource(msg); RMConfiguration config = getManager().getEffectiveConfiguration(msg); String wsaNamespace = config.getAddressingNamespace(); String rmNamespace = config.getRMNamespace(); seq = (SourceSequence)invocationContext.get(SourceSequence.class.getName()); } else { seq = getManager().getSequence(inSeqId, msg, maps); os = cached; getManager().initializeInterceptorChain(msg); RMStore store = getManager().getStore(); if (null != store) { store.persistOutgoing(rmpsOut.getSourceSequence(), null);
message = m; retries = 0; RMConfiguration cfg = manager.getEffectiveConfiguration(message); long baseRetransmissionInterval = cfg.getBaseRetransmissionInterval().longValue(); next = new Date(System.currentTimeMillis() + baseRetransmissionInterval); nextInterval = baseRetransmissionInterval * backoff; RetryPolicyType rmrp = null != manager.getSourcePolicy() ? manager.getSourcePolicy().getRetryPolicy() : null; maxRetries = null != rmrp ? rmrp.getMaxRetries() : -1; number = rmprops.getSequence().getMessageNumber(); if (null != manager.getTimer() && maxRetries != 0) { schedule();
@PostConstruct void initialise() { if (configuration == null) { getConfiguration().setExponentialBackoff(true); setSourcePolicy(null); setDestinationPolicy(dp);
public SourceSequence getSequence(Identifier inSeqId, Message message, AddressingProperties maps) throws RMException { Source source = getSource(message); SourceSequence seq = source.getCurrent(inSeqId); RMConfiguration config = getEffectiveConfiguration(message); if (null == seq || seq.isExpired()) { source.getReliableEndpoint().getServant().setUnattachedIdentifier(inSeqId); relatesTo = (new org.apache.cxf.ws.addressing.ObjectFactory()).createRelatesToType(); Destination destination = getDestination(message); DestinationSequence inSeq = inSeqId == null ? null : destination.getSequence(inSeqId); relatesTo.setValue(inSeq != null ? inSeq.getCorrelationID() : null);
public static ObjectName getManagedObjectName(RMManager manager) throws JMException { StringBuilder buffer = new StringBuilder(); writeTypeProperty(buffer, manager.getBus(), "WSRM.Manager"); // Added the instance id to make the ObjectName unique buffer.append(',').append(ManagementConstants.INSTANCE_ID_PROP).append('=').append(manager.hashCode()); return new ObjectName(buffer.toString()); }
void scheduleAcknowledgement(long acknowledgementInterval) { AcksPolicyType ap = destination.getManager().getDestinationPolicy().getAcksPolicy(); if (acknowledgementInterval > 0 && getMonitor().getMPM() >= (ap == null ? 10 : ap.getIntraMessageThreshold())) { LOG.fine("Schedule deferred acknowledgment"); scheduleDeferredAcknowledgement(acknowledgementInterval); } else { LOG.fine("Schedule immediate acknowledgment"); scheduleImmediateAcknowledgement(); destination.getManager().getTimer().schedule( new ImmediateFallbackAcknowledgment(), ap == null ? 1000L : ap.getImmediaAcksTimeout()); } }
public void handleMessage(Message message) { LOG.entering(getClass().getName(), "handleMessage"); // Capturing the soap envelope. In case of WSS was activated, decrypted envelope is captured. if (!MessageUtils.getContextualBoolean(message, Message.ROBUST_ONEWAY, false) && isApplicationMessage(message) && (getManager().getStore() != null || (getManager().getDestinationPolicy() != null && getManager() .getDestinationPolicy().getRetryPolicy() != null))) { CachedOutputStream saved = new CachedOutputStream(); SOAPMessage soapMessage = message.getContent(SOAPMessage.class); if (soapMessage != null) { try { javax.xml.transform.Source envelope = soapMessage.getSOAPPart().getContent(); StaxUtils.copy(envelope, saved); saved.flush(); // create a new source part from cos InputStream is = saved.getInputStream(); // close old saved content closeOldSavedContent(message); // keep References to clean-up tmp files in RMDeliveryInterceptor setCloseable(message, saved, is); StreamSource source = new StreamSource(is); soapMessage.getSOAPPart().setContent(source); // when WSS was activated, saved content still contains soap headers to be removed message.put(RMMessageConstants.SAVED_CONTENT, removeUnnecessarySoapHeaders(saved)); } catch (SOAPException | IOException | XMLStreamException e) { throw new Fault(e); } } } }
/** * Get configuration after applying policies. * * @param msg * @return configuration (non-<code>null</code>) */ public RMConfiguration getEffectiveConfiguration(Message msg) { return RMPolicyUtilities.getRMConfiguration(getConfiguration(), msg); }
RMEndpoint rme = getManager().getReliableEndpoint(message); Destination destination = getManager().getDestination(message);
Destination destination = getManager().getDestination(message); if (destination != null) { destination.releaseDeliveringStatus(message); getManager().getRedeliveryQueue().addUndelivered(message);
RMConfiguration config = getManager().getEffectiveConfiguration(msg); String wsaNamespace = config.getAddressingNamespace(); String rmNamespace = config.getRMNamespace(); ProtocolVariation protocol = ProtocolVariation.findVariant(rmNamespace, wsaNamespace); RMContextUtils.setProtocolVariation(msg, protocol); Destination destination = getManager().getDestination(msg);
RMConfiguration config = getConfiguration(); if (rmUri != null) { config.setRMNamespace(rmUri); return rme; rme = createReliableEndpoint(endpoint); org.apache.cxf.transport.Destination destination = message.getExchange().getDestination(); EndpointReferenceType replyTo = null;