else if (m.getName().equals("createBytesMessage")) { return new JBossBytesMessage(); } else if (m.getName().equals("createMapMessage")) { return new JBossMapMessage(); } else if (m.getName().equals("createObjectMessage")) { JBossObjectMessage msg = new JBossObjectMessage(); if (mi.getArguments().length != 0) { msg.setObject((Serializable)mi.getArguments()[0]); } return msg; } else if (m.getName().equals("createStreamMessage")) { return new JBossStreamMessage(); } else if (m.getName().equals("createTextMessage")) { JBossTextMessage msg = new JBossTextMessage(); if (mi.getArguments().length != 0) { msg.setText((String)mi.getArguments()[0]); } return msg; }
   public Object invoke(Invocation invocation) throws Throwable   {      if (invocation instanceof MethodInvocation)      {         MethodInvocation mi = (MethodInvocation)invocation;         Method m = mi.getMethod();         if (m.getName().equals("createMessage"))         {            return new JBossMessage();         }      }      return invocation.invokeNext();   }