public void setCorrelationKey(CorrelationKey key) { _ckeySet = new CorrelationKeySet(); _ckeySet.add(key); }
public void setCorrelationKeySet(CorrelationKeySet correlationKeySet) { this.correlationKeySet = correlationKeySet == null ? null : correlationKeySet.toCanonicalString(); } public Integer getRetryCount() {
/** * Checks if an incoming message with this correlation key set can be accepted by the given * correlation key set. * * @param candidateKeySet a correlation key set stored in a route * @param isAllRoute use true if the route="all" is set * @return return true if routable */ public boolean isRoutableTo(CorrelationKeySet candidateKeySet, boolean isAllRoute) { boolean isRoutable = containsAll(candidateKeySet); if( isAllRoute ) { isRoutable = isRoutable || candidateKeySet.isOpaque() && isEmpty(); } return isRoutable; }
public CorrelationKeySet getCorrelationKeySet() { // backward compatibility; add up if (_correlationKey != null) { if( _correlationKeySet == null ) { _correlationKeySet = new CorrelationKeySet(); } if(!_correlationKeySet.contains(_correlationKey)) { _correlationKeySet.add(_correlationKey); } } return _correlationKeySet; }
CorrelationKeySet explicitKeySet = new CorrelationKeySet(); for( CorrelationKey ckey : correlationKeys ) { containsNonOpaque = true; explicitKeySet.add(ckey); CorrelationKeySet subKeySet = new CorrelationKeySet(); int bitPattern = setIndex; // the bitPattern will be 0b0000, 0b0001, 0b0010 and so on Iterator<CorrelationKey> ckeys = explicitKeySet.iterator(); while( ckeys.hasNext() && bitPattern > 0 ) { // bitPattern > 0 condition saves half of the iterations CorrelationKey ckey = ckeys.next(); if( (bitPattern & 0x01) > 0 ) { subKeySet.add(ckey); if(!subKeySet.isEmpty()) { // we don't want an empty set subSets.add(subKeySet); subSets.add(new CorrelationKeySet());
try { PickResponseChannel pickResponseChannel = newChannel(PickResponseChannel.class); CorrelationKeySet keySet = new CorrelationKeySet(); PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.partnerLink); for( OScope.CorrelationSet cset : _oevent.joinCorrelations ) { if(getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) { keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset))); throw new FaultException(_oevent.getOwner().constants.qnCorrelationViolation,"Correlation not initialized."); keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset))); if( keySet.isEmpty() ) { keySet.add(new CorrelationKey("-1", new String[] {sessionId}));
public void enqueueMessage(MessageExchangeDAO mex, CorrelationKeySet correlationKeySet) { entering("CorrelatorDaoImpl.enqueueMessage"); String hdr = "enqueueMessage(mex=" + ((MessageExchangeDaoImpl) mex)._hobj.getId() + " keySet=" + correlationKeySet.toCanonicalString() + "): "; if (__log.isDebugEnabled()) __log.debug(hdr); for( CorrelationKeySet aSubSet : correlationKeySet.findSubSets() ) { HCorrelatorMessage mcor = new HCorrelatorMessage(); mcor.setCorrelator(_hobj); mcor.setCreated(new Date()); mcor.setMessageExchange((HMessageExchange) ((MessageExchangeDaoImpl) mex)._hobj); mcor.setCorrelationKey(aSubSet.toCanonicalString()); getSession().save(mcor); if (__log.isDebugEnabled()) __log.debug(hdr + "saved " + mcor); } }
public CorrelationKeySet getCorrelationKeySet() { return new CorrelationKeySet(correlationKeySet); } public void setCorrelationKeySet(CorrelationKeySet correlationKeySet) {
/** * Checks if this correlation key set contains all correlation keys from the given correlation key set. * * @param c a correlation key set * @return return true if this correlation key set is a superset */ public boolean containsAll(CorrelationKeySet c) { Iterator<CorrelationKey> e = c.iterator(); while (e.hasNext()) if (!contains(e.next())) return false; return true; }
/** * Restores the state of this correlation key set from a canonical form. * * @param canonicalForm a canonical form of correlation key set */ public void restore(String canonicalForm) { if( canonicalForm == null || canonicalForm.trim().length() == 0 ) return; if( canonicalForm.startsWith("@") ) { parseCanonicalForm(canonicalForm); } else { version = VERSION_1; add( new CorrelationKey(canonicalForm) ); } }
public CorrelationKey getCorrelationKey() { return _ckeySet.iterator().next(); }
} else if( ch == ',' ) { if( buf.toString().trim().length() != 0 ) { add( new CorrelationKey(buf.toString()) ); } else if( ch == '?' ) { // this is only a convenient feature for testing if( buf.toString().trim().length() != 0 ) { add( new OptionalCorrelationKey(buf.toString()) ); version = buf.toString(); } else { add( new CorrelationKey(buf.toString()) );
@Override public boolean equals(Object o) { if( o == null || !(o instanceof CorrelationKeySet) ) { return false; } CorrelationKeySet another = (CorrelationKeySet)o; if( correlationKeys.size() != another.correlationKeys.size() ) { return false; } return containsAll(another); }
/** * Returns a canonical form of this correlation key set. * * @return */ public String toCanonicalString() { StringBuffer buf = new StringBuffer(); for( CorrelationKey ckey : correlationKeys ) { if( buf.length() > 0 ) { buf.append(","); } buf.append("[").append(escapeRightBracket(ckey.toCanonicalString())).append("]"); } return "@" + VERSION_2 + buf.toString(); }
public CorrelationKeySet getKeySet() { // backward-compatibility; add up keys if( _keys.size() > 0 && _keySet == null ) { _keySet = new CorrelationKeySet(); } for (CorrelationKey aKey : _keys) { if (aKey != null && !_keySet.contains(aKey)) { _keySet.add(aKey); } } return _keySet; }
__log.debug(hdr); List<CorrelationKeySet> subSets = keySet.findSubSets(); Query qry = getSession().createFilter(_hobj.getMessageCorrelations(), generateUnmatchedQuery(subSets)); for( int i = 0; i < subSets.size(); i++ ) { qry.setString("s" + i, subSets.get(i).toCanonicalString());
public CorrelationKeySet getCorrelationKeySet() { return new CorrelationKeySet((String) _jobDetail.get("ckeySet")); }
public CorrelationKey getCorrelationKey() { return keySet.iterator().next(); }
public void setCorrelationKey(CorrelationKey ckey) { keySet = new CorrelationKeySet(); keySet.add(ckey); } }
List<CorrelationKeySet> subSets = keySet.findSubSets(); q.setString("s" + i, subSets.get(i).toCanonicalString());