/** * @return null if <code>filterStr</code> is null or an empty String and a valid filter else * @throws HornetQException if the string does not correspond to a valid filter */ public static Filter createFilter(final SimpleString filterStr) throws HornetQException { if (filterStr == null || filterStr.length() == 0) { return null; } else { return new FilterImpl(filterStr); } }
@Override public int read(final char[] cbuf, final int off, final int len) throws IOException { synchronized (simpleString) { if (off < 0 || off > cbuf.length || len < 0 || off + len > cbuf.length || off + len < 0) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } int length = simpleString.length(); if (next >= length) { return -1; } int n = Math.min(length - next, len); simpleString.getChars(next, next + n, cbuf, off); next += n; return n; } }
@Override public int read(final char[] cbuf, final int off, final int len) throws IOException { synchronized (simpleString) { if (off < 0 || off > cbuf.length || len < 0 || off + len > cbuf.length || off + len < 0) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } int length = simpleString.length(); if (next >= length) { return -1; } int n = Math.min(length - next, len); simpleString.getChars(next, next + n, cbuf, off); next += n; return n; } }
public void unproposed(final SimpleString groupID) { if (groupID.toString().endsWith("." + this.getName())) { // this means this unproposed belongs to this routing, so we will // remove this group // This is removing the name and a . added, giving us the original groupID used // this is because a groupID is stored per queue, and only this queue is expiring at this point final SimpleString groupIDToRemove = (SimpleString)groupID.subSequence(0, groupID.length() - getName().length() - 1); // using an executor so we don't want to hold anyone just because of this getExecutor().execute(new Runnable() { public void run() { synchronized (QueueImpl.this) { if (groups.remove(groupIDToRemove) != null) { HornetQServerLogger.LOGGER.debug("Removing group after unproposal " + groupID + " from queue " + QueueImpl.this); } else { HornetQServerLogger.LOGGER.debug("Couldn't remove Removing group " + groupIDToRemove + " after unproposal on queue " + QueueImpl.this); } } } }); } }
if (srcEnd > length())
if (srcEnd > length())
/** * @return null if <code>filterStr</code> is null or an empty String and a valid filter else * @throws HornetQException if the string does not correspond to a valid filter */ public static Filter createFilter(final SimpleString filterStr) throws HornetQException { if (filterStr == null || filterStr.length() == 0) { return null; } HashMap<SimpleString, Identifier> identifierMap = new HashMap<SimpleString, Identifier>(); Object result0; try { result0 = new FilterParser().parse(filterStr, identifierMap); } catch (Throwable e) { HornetQServerLogger.LOGGER.invalidFilter(e, filterStr); throw HornetQMessageBundle.BUNDLE.invalidFilter(e, filterStr); } return new FilterImpl(filterStr, identifierMap, result0); }
if (escapeString.length() != 1)
if (escapeString.length() != 1)