{ Message mess = (Message)routable;
{ org.jboss.messaging.core.Message m;    if (routable.isReference()) { m = ((MessageReference)routable).getMessage(); } else { m = (org.jboss.messaging.core.Message)routable; }   if (!(m instanceof Message)) { return false; }  Message mess = (Message)m;
	public synchronized boolean accept(Routable routable)   {      try      {			Message mess = (Message)routable;			         // Set the identifiers values         Iterator i = identifiers.values().iterator();                  while (i.hasNext())         {            Identifier id = (Identifier) i.next();                        Object find = mess.getObjectProperty(id.name);                        if (find == null)               find = getHeaderFieldReferences(mess, id.name);                        if (find == null)               id.value = null;            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))                  id.value = find;               else                  throw new Exception("Bad property '" + id.name + "' type: " + type);            }         }                  // Compute the result of this operator         Object res;                  if (resultType.equals(Identifier.class))            res = ((Identifier)result).value;         else if (resultType.equals(Operator.class))         {            Operator op = (Operator) result;            res = op.apply();         }         else            res = result;                  if (res == null)            return false;                  if (!(res.getClass().equals(Boolean.class)))            throw new Exception("Bad object type: " + res);                  return ((Boolean) res).booleanValue();      }      catch (Exception e)      {         cat.warn("Invalid selector: " + selector, e);         return false;      }   }