< prev index next >

## src/com/sun/javatest/agent/AgentMain.java

Print this page

    *** 372,382 ****
              String pkg = s.substring(0, s.lastIndexOf('.'));

              switch (mode) {
              case ACTIVE:
                  try {
    !                 Class c = Class.forName(pkg + ".ActiveConnectionFactory");
                      Constructor m = c.getConstructor(new Class[] {String.class, int.class});
                      Object[] args = { activeHost, new Integer(activePort) };
                      return (ConnectionFactory)(m.newInstance(args));
                  }
                  catch (Throwable e) {
    --- 372,382 ----
              String pkg = s.substring(0, s.lastIndexOf('.'));

              switch (mode) {
              case ACTIVE:
                  try {
    !                 Class<?> c = Class.forName(pkg + ".ActiveConnectionFactory");
                      Constructor m = c.getConstructor(new Class[] {String.class, int.class});
                      Object[] args = { activeHost, new Integer(activePort) };
                      return (ConnectionFactory)(m.newInstance(args));
                  }
                  catch (Throwable e) {
    *** 389,399 ****
                      throw new Fault(msgs);
                  }

              case PASSIVE:
                  try {
    !                 Class c = Class.forName(pkg + ".PassiveConnectionFactory");
                      Constructor m = c.getConstructor(new Class[] {int.class, int.class});
                      Object[] args = { new Integer(passivePort), new Integer(concurrency + 1) };
                      return (ConnectionFactory)(m.newInstance(args));
                  }
                  catch (Throwable e) {
    --- 389,399 ----
                      throw new Fault(msgs);
                  }

              case PASSIVE:
                  try {
    !                 Class<?> c = Class.forName(pkg + ".PassiveConnectionFactory");
                      Constructor m = c.getConstructor(new Class[] {int.class, int.class});
                      Object[] args = { new Integer(passivePort), new Integer(concurrency + 1) };
                      return (ConnectionFactory)(m.newInstance(args));
                  }
                  catch (Throwable e) {
    *** 410,420 ****
                      }
                  }

              case SERIAL:
                  try {
    !                 Class c = Class.forName(pkg + ".SerialPortConnectionFactory");
                      Constructor m = c.getConstructor(new Class[] {String.class, String.class, int.class});
                      Object[] args = {serialPort, Agent.productName, new Integer(10*1000)};
                      return (ConnectionFactory)(m.newInstance(args));
                  }
                  catch (InvocationTargetException e) {
    --- 410,420 ----
                      }
                  }

              case SERIAL:
                  try {
    !                 Class<?> c = Class.forName(pkg + ".SerialPortConnectionFactory");
                      Constructor m = c.getConstructor(new Class[] {String.class, String.class, int.class});
                      Object[] args = {serialPort, Agent.productName, new Integer(10*1000)};
                      return (ConnectionFactory)(m.newInstance(args));
                  }
                  catch (InvocationTargetException e) {

< prev index next >