[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq/selectors Selector.java
User: starksm Date: 02/04/09 16:55:57 Modified:src/main/org/jboss/mq/selectors Tag: Branch_2_4 Selector.java Log: Treat empty selectors as null selectors and include the selector in the InvalidSelectorException. Fixes Bug #537564. Revision ChangesPath No revision No revision 1.3.2.3 +3 -3 jbossmq/src/main/org/jboss/mq/selectors/Selector.java Index: Selector.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/selectors/Selector.java,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -u -r1.3.2.2 -r1.3.2.3 --- Selector.java 28 Nov 2001 06:15:32 - 1.3.2.2 +++ Selector.java 9 Apr 2002 23:55:57 - 1.3.2.3 @@ -21,7 +21,7 @@ * @author Norbert Lataille ([EMAIL PROTECTED]) * @author Juha Lindfors ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.3.2.2 $ + * @version$Revision: 1.3.2.3 $ */ public class Selector { @@ -42,11 +42,11 @@ result = bob.parse( sel, identifiers ); } catch ( Exception e ) { - InvalidSelectorException exception = new InvalidSelectorException( The selector is invalid. ); + InvalidSelectorException exception = new InvalidSelectorException(The selector is invalid:+sel); exception.setLinkedException( e ); throw exception; } - + //Log.notice(result.toString()); } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq/selectors Selector.java
User: ejort Date: 02/01/12 17:10:03 Modified:src/main/org/jboss/mq/selectors Selector.java Log: Remove direct reference log4j category in preparation for log4j 1.2 Revision ChangesPath 1.7 +3 -3 jbossmq/src/main/org/jboss/mq/selectors/Selector.java Index: Selector.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/selectors/Selector.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Selector.java 2001/12/13 03:28:24 1.6 +++ Selector.java 2002/01/13 01:10:03 1.7 @@ -12,7 +12,7 @@ import javax.jms.InvalidSelectorException; import javax.jms.JMSException; -import org.apache.log4j.Category; +import org.jboss.logging.Logger; import org.jboss.mq.SpyMessage; @@ -24,12 +24,12 @@ * @author a href=mailto:[EMAIL PROTECTED];Jason Dillon/a * @author [EMAIL PROTECTED] * @createdAugust 16, 2001 - * @version$Revision: 1.6 $ + * @version$Revision: 1.7 $ */ public class Selector { /** The logging interface */ - static Category cat = Category.getInstance(Selector.class); + static Logger cat = Logger.getLogger(Selector.class); /** The ISelectorParser implementation class */ private static Class parserClass = parser.class; ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq/selectors Selector.java
User: dmaplesden Date: 01/12/12 19:28:24 Modified:src/main/org/jboss/mq/selectors Selector.java Log: remove overly verbose logging Revision ChangesPath 1.6 +5 -5 jbossmq/src/main/org/jboss/mq/selectors/Selector.java Index: Selector.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/selectors/Selector.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Selector.java 2001/10/28 04:07:35 1.5 +++ Selector.java 2001/12/13 03:28:24 1.6 @@ -24,7 +24,7 @@ * @author a href=mailto:[EMAIL PROTECTED];Jason Dillon/a * @author [EMAIL PROTECTED] * @createdAugust 16, 2001 - * @version$Revision: 1.5 $ + * @version$Revision: 1.6 $ */ public class Selector { @@ -103,10 +103,10 @@ if (find == null) { - if (cat.isDebugEnabled()) - { - cat.debug(Warning : missing property + id.name); - } + //if (cat.isDebugEnabled()) + //{ + // cat.debug(Warning : missing property + id.name); + //} id.value = null; } else ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq/selectors Selector.java
User: starksm Date: 01/11/27 22:15:32 Modified:src/main/org/jboss/mq/selectors Tag: Branch_2_4 Selector.java Log: Complete switch to org.jboss.logging.Logger and use trace to reduce default logging Add support for package version manifest headers Revision ChangesPath No revision No revision 1.3.2.2 +84 -49jbossmq/src/main/org/jboss/mq/selectors/Selector.java Index: Selector.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/selectors/Selector.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- Selector.java 2001/08/23 03:57:12 1.3.2.1 +++ Selector.java 2001/11/28 06:15:32 1.3.2.2 @@ -12,6 +12,7 @@ import javax.jms.JMSException; +import org.jboss.logging.Logger; import org.jboss.mq.SpyMessage; /** @@ -20,111 +21,145 @@ * @author Norbert Lataille ([EMAIL PROTECTED]) * @author Juha Lindfors ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.3.2.1 $ + * @version$Revision: 1.3.2.2 $ */ -public class Selector { +public class Selector +{ + static Logger log = Logger.getLogger( Selector.class ); + public HashMap identifiers; // HashMap of Identifiers public Objectresult; - - static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance( Selector.class ); - + public Selector( String sel ) - throws JMSException { + throws JMSException + { parser bob = new parser(); identifiers = new HashMap(); - - try { + + try + { result = bob.parse( sel, identifiers ); - } catch ( Exception e ) { + } catch ( Exception e ) + { InvalidSelectorException exception = new InvalidSelectorException( The selector is invalid. ); exception.setLinkedException( e ); throw exception; } - + //Log.notice(result.toString()); } - + public boolean test( SpyMessage mes ) - throws JMSException { - - try { - + throws JMSException + { + + try + { + //Set the identifiers values Iterator i = identifiers.values().iterator(); - - while ( i.hasNext() ) { + + while ( i.hasNext() ) + { Identifier id = ( Identifier )i.next(); - + Object find = mes.getObjectProperty( id.name ); - -if ( find == null ) { + +if ( find == null ) +{ find = getHeaderFieldReferences( mes, id.name ); } - -if ( find == null ) { - cat.debug( Warning : missing property + id.name ); + +if ( find == null ) +{ + log.debug( Warning : missing property + id.name ); id.value = null; -} else { +} else +{ Class type = find.getClass(); if ( type.equals( Boolean.class ) || type.equals( String.class ) - || type.equals( Double.class ) || type.equals( Float.class ) - || type.equals( Integer.class ) || type.equals( Long.class ) - || type.equals( Short.class ) || type.equals( Byte.class ) ) { + || type.equals( Double.class ) || type.equals( Float.class ) + || type.equals( Integer.class ) || type.equals( Long.class ) + || type.equals( Short.class ) || type.equals( Byte.class ) ) + { id.value = find; - } else { + } + else + { throw new Exception( Bad property type ! ); } //Log.notice(SEL:+id.name+ =+id.value); } } - + //Compute the result of this operator Object res; - - if ( result.getClass().equals( Identifier.class ) ) { + + if ( result.getClass().equals( Identifier.class ) ) + { res = ( ( Identifier )result ).value; - } else if ( result.getClass().equals( Operator.class ) ) { + } else if ( result.getClass().equals( Operator.class ) ) + { res = ( ( Operator )result ).apply(); - } else { + } else + { res = result; } - - if ( res == null ) { + + if ( res == null ) + { return false; } -
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq/selectors Selector.java
User: chirino Date: 01/10/27 21:07:35 Modified:src/main/org/jboss/mq/selectors Selector.java Log: Reorganized the JMS message headers into a Header object so that the MessageCahe can drop the message body from memory, but keep the headers. Also fixed a bug witht he Browse() that was introduced with the message cache. Revision ChangesPath 1.5 +10 -10jbossmq/src/main/org/jboss/mq/selectors/Selector.java Index: Selector.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/selectors/Selector.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Selector.java 2001/08/24 17:27:08 1.4 +++ Selector.java 2001/10/28 04:07:35 1.5 @@ -24,7 +24,7 @@ * @author a href=mailto:[EMAIL PROTECTED];Jason Dillon/a * @author [EMAIL PROTECTED] * @createdAugust 16, 2001 - * @version$Revision: 1.4 $ + * @version$Revision: 1.5 $ */ public class Selector { @@ -77,7 +77,7 @@ // } } - public boolean test(SpyMessage mes) throws JMSException + public boolean test(SpyMessage.Header mes) throws JMSException { try { @@ -87,7 +87,7 @@ while (i.hasNext()) { Identifier id = (Identifier)i.next(); -Object find = mes.getObjectProperty(id.name); +Object find = mes.jmsProperties.get(id.name); // if (cat.isDebugEnabled()) { //cat.debug(Identifier: + id); //cat.debug(Property: + find); @@ -180,7 +180,7 @@ } // [JPL] - private Object getHeaderFieldReferences(SpyMessage msg, String idName) + private Object getHeaderFieldReferences(SpyMessage.Header header, String idName) throws JMSException { // JMS 3.8.1.1 -- Message header field references are restricted to: @@ -189,27 +189,27 @@ // if (idName.equals(JMSDeliveryMode)) { - return new Integer(msg.getJMSDeliveryMode()); + return new Integer(header.jmsDeliveryMode); } else if (idName.equals(JMSPriority)) { - return new Integer(msg.getJMSPriority()); + return new Integer(header.jmsPriority); } else if (idName.equals(JMSMessageID)) { - return msg.getJMSMessageID(); + return header.jmsMessageID; } else if (idName.equals(JMSTimestamp)) { - return new Long(msg.getJMSTimestamp()); + return new Long(header.jmsTimeStamp); } else if (idName.equals(JMSCorrelationID)) { - return msg.getJMSCorrelationID(); + return header.jmsCorrelationIDString; } else if (idName.equals(JMSType)) { - return msg.getJMSType(); + return header.jmsType; } else { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq/selectors Selector.java
User: user57 Date: 01/08/21 17:53:35 Modified:src/main/org/jboss/mq/selectors Selector.java Log: o added some commented logging (too verbose to leave it for now) o changed exceptions to return a bit more detail Revision ChangesPath 1.3 +105 -62 jbossmq/src/main/org/jboss/mq/selectors/Selector.java Index: Selector.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/selectors/Selector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Selector.java 2001/08/17 03:04:06 1.2 +++ Selector.java 2001/08/22 00:53:35 1.3 @@ -8,10 +8,12 @@ import java.util.HashMap; import java.util.Iterator; -import javax.jms.InvalidSelectorException; +import javax.jms.InvalidSelectorException; import javax.jms.JMSException; +import org.apache.log4j.Category; + import org.jboss.mq.SpyMessage; /** @@ -19,112 +21,153 @@ * * @author Norbert Lataille ([EMAIL PROTECTED]) * @author Juha Lindfors ([EMAIL PROTECTED]) + * @author a href=mailto:[EMAIL PROTECTED];Jason Dillon/a * @createdAugust 16, 2001 - * @version$Revision: 1.2 $ + * @version$Revision: 1.3 $ */ -public class Selector { - public HashMap identifiers; - // HashMap of Identifiers - public Objectresult; +public class Selector +{ + public HashMap identifiers; + public Object result; + private Class resultType; + + static Category cat = Category.getInstance(Selector.class); - static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance( Selector.class ); - - public Selector( String sel ) - throws JMSException { + public Selector(String sel) throws JMSException { parser bob = new parser(); identifiers = new HashMap(); try { - result = bob.parse( sel, identifiers ); - } catch ( Exception e ) { - InvalidSelectorException exception = new InvalidSelectorException( The selector is invalid. ); - exception.setLinkedException( e ); + result = bob.parse(sel, identifiers); + resultType = result.getClass(); + } + catch (Exception e) { + InvalidSelectorException exception = +new InvalidSelectorException(The selector is invalid.); + exception.setLinkedException(e); throw exception; } - //Log.notice(result.toString()); +// if (cat.isDebugEnabled()) { +// cat.debug(result: + resultType + = + result); +// } } - - public boolean test( SpyMessage mes ) - throws JMSException { + public boolean test(SpyMessage mes) throws JMSException { try { - - //Set the identifiers values + // Set the identifiers values Iterator i = identifiers.values().iterator(); - - while ( i.hasNext() ) { -Identifier id = ( Identifier )i.next(); -Object find = mes.getObjectProperty( id.name ); + while (i.hasNext()) { +Identifier id = (Identifier)i.next(); +Object find = mes.getObjectProperty(id.name); +// if (cat.isDebugEnabled()) { +//cat.debug(Identifier: + id); +//cat.debug(Property: + find); +//if (find != null) { +// cat.debug(Property type: + find.getClass()); +//} +// } -if ( find == null ) { - find = getHeaderFieldReferences( mes, id.name ); +if (find == null) { + find = getHeaderFieldReferences(mes, id.name); } -if ( find == null ) { - cat.debug( Warning : missing property + id.name ); +if (find == null) { + if (cat.isDebugEnabled()) { + cat.debug(Warning : missing property + id.name); + } id.value = null; -} else { +} +else { Class type = find.getClass(); - if ( type.equals( Boolean.class ) || type.equals( String.class ) - || type.equals( Double.class ) || type.equals( Float.class ) - || type.equals( Integer.class ) || type.equals( Long.class ) - || type.equals( Short.class ) || type.equals( Byte.class ) ) { + if (type.equals(Boolean.class) || + type.equals(String.class) || + type.equals(Double.class) || + type.equals(Float.class) || + type.equals(Integer.class) || + type.equals(Long.class)|| + type.equals(Short.class)