Examples of XMLDispatcherClient


Examples of org.xooof.xmldispatcher.interfaces.XMLDispatcherClient

      int c;
      java.io.Reader input;
      StringBuffer xmlRqst;
     
      String xmlRply = null;
      XMLDispatcherClient xdCli;
     
      for (int i=0; i<args.length; i++)
      {
        if (args[i].equals("--verb"))
        {
          i++;
          verb = args[i];
        }
        else if (args[i].equals("--appName"))
        {
          i++;
          appName = args[i];
        }
        else if (args[i].equals("--className"))
        {
          i++;
          className = args[i];
        }
        else if (args[i].equals("--methodName"))
        {
          i++;
          methodName = args[i];
        }
        else if (args[i].equals("--instanceId"))
        {
          i++;
          instanceId = args[i];
        }
        else
        {
          throw new XMLDispatcherCommException("Unexpected argument: '"+args[i]+"'");
        }
      }   
     
      if (verb == null || appName == null ||
          className == null || methodName == null)
        {
          throw new XMLDispatcherCommException("missing argument");
        }
     
      input = new BufferedReader(new InputStreamReader(System.in));
      xmlRqst = new StringBuffer();
      while (-1 != (c = input.read()))
      {
        xmlRqst.append((char)c);
      }
     
      xdCli = new XMLDispatcherEJBClient(appName);
   
      if (verb.equals("DispatchClassMethodXML"))
      {
        xmlRply = xdCli.dispatchClassMethodXML(className,methodName,xmlRqst.toString());
      }
      else if (verb.equals("DispatchNewInstanceMethodXML"))
      {
        xmlRply = xdCli.dispatchNewInstanceMethodXML(className,methodName,xmlRqst.toString());
      }
      else if (verb.equals("DispatchInstanceMethodXML"))
      {
        if (instanceId == null)
        {
          throw new XMLDispatcherCommException("Missing instanceId");
        }
        xmlRply = xdCli.dispatchInstanceMethodXML(className,methodName,instanceId,xmlRqst.toString());
      }
      else
      {
        throw new XMLDispatcherCommException("Invalid verb: "+verb);
      }
View Full Code Here

Examples of org.xooof.xmldispatcher.interfaces.XMLDispatcherClient

    System.out.println(getClass()+"::ejbCreate()");
   
    Context jndiContext = new InitialContext();
   
    // connect to XMLDispatcher bean
    XMLDispatcherClient xd =
      new XMLDispatcherEJBClient(
                                 new XMLDispatcherAutoConnect(
                                                              jndiContext,
                                                              "java:comp/env/ejb/XMLDispatcher"));
   
View Full Code Here

Examples of org.xooof.xmldispatcher.interfaces.XMLDispatcherClient

                                       HttpServletRequest request,
                                       HttpServletResponse response)
    throws java.io.IOException, XMLDispatcherException, XMLDispatcherCommException
  {
    // obtain XMLDispatcherClient
    XMLDispatcherClient xd = getXMLDispatcherClient(appName);

    // restore session data
    xd.setSessionData(sessionData);

    // dispatch request
    String xmlRply;
    if (verb == null)
    {
      throw new XMLDispatcherSystemException("Invalid verb: null");
    }
    else if (verb.equals(EnvelopeConstants.stringDispatchClassMethodXML))
    {
      xmlRply = xd.dispatchClassMethodXML(className,methodName,xmlRqst);
    }
    else if (verb.equals(EnvelopeConstants.stringDispatchNewInstanceMethodXML))
    {
      xmlRply = xd.dispatchNewInstanceMethodXML(className,methodName,xmlRqst);
    }
    else if (verb.equals(EnvelopeConstants.stringDispatchInstanceMethodXML))
    {
      xmlRply = xd.dispatchInstanceMethodXML(className,methodName,instanceId,xmlRqst);
    }
    else
    {
      throw new XMLDispatcherSystemException("Invalid verb: " + verb);
    }
   
    return new XMLDispatcherRply(xmlRply,xd.getSessionData());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.