@Override public void connect() { try { final Field field = WSHumanTaskHandler.class.getDeclaredField("client"); TaskClient client = (TaskClient) field.get(this); if (client == null) { client = new TaskClient(new JMSTaskClientConnector( "org.jbpm.process.workitem.wsht.WSThroughJMSHumanTaskHandler", new JMSTaskClientHandler(SystemEventListenerFactory .getSystemEventListener()), WSHumanTaskJMSProperties.getInstance().getProperties(), new InitialContext(WSHumanTaskJMSProperties.getInstance().getProperties()))); field.set(this, client); boolean connected = client.connect(); if (!connected) { throw new IllegalArgumentException("Could not connect to the task client"); } } super.connect(); } catch (NoSuchFieldException e) { throw new RuntimeException("Problem configuring the human task connector", e); } catch (IllegalAccessException e) { throw new RuntimeException("Problem accessing the human task connector", e); } catch (NamingException e) { throw new RuntimeException("Problem accesing the JNDI directory", e); } } }
@Override public void connect() { try { final Field field = WSHumanTaskHandler.class.getDeclaredField("client"); TaskClient client = (TaskClient) field.get(this); if (client == null) { client = new TaskClient(new JMSTaskClientConnector( "org.drools.process.workitem.wsht.WSThroughJMSHumanTaskHandler", new JMSTaskClientHandler(SystemEventListenerFactory .getSystemEventListener()), WSHumanTaskJMSProperties.getInstance().getProperties(), new InitialContext(WSHumanTaskJMSProperties.getInstance().getProperties()))); field.set(this, client); boolean connected = client.connect(); if (!connected) { throw new IllegalArgumentException("Could not connect to the task client"); } } super.connect(); } catch (NoSuchFieldException e) { throw new RuntimeException("Problem configuring the human task connector", e); } catch (IllegalAccessException e) { throw new RuntimeException("Problem accessing the human task connector", e); } catch (NamingException e) { throw new RuntimeException("Problem accesing the JNDI directory", e); } } }
protected TaskService createClient(String clientName) { TaskClient taskClient = new AsyncHornetQTaskClient(); taskClient.connect("127.0.0.1", 5153); TaskService client = new SyncTaskServiceWrapper(taskClient); return client; }
private void init() { taskClient = new TaskClient(new HornetQTaskClientConnector("client 1", new HornetQTaskClientHandler(SystemEventListenerFactory.getSystemEventListener()))); boolean connected = taskClient.connect("127.0.0.1", 5443); System.out.println("Connected ? =>" + connected); }
public void connect() { if (client == null) { client = new TaskClient(new MinaTaskClientConnector("org.drools.process.workitem.wsht.WSHumanTaskHandler", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener()))); boolean connected = client.connect(ipAddress, port); if (!connected) { throw new IllegalArgumentException("Could not connect task client"); } registerTaskEventHandlers(); } }
public void connect() { if (!initialized) { if (client == null) { client = new TaskClient(new MinaTaskClientConnector("org.drools.process.workitem.wsht.WSHumanTaskHandler", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener()))); boolean connected = client.connect(ipAddress, port); if (!connected) { throw new IllegalArgumentException("Could not connect task client"); } } registerTaskEventHandlers(); initialized = true; } }
String host = properties.getProperty("jbpm.console.task.service.host", Utils.DEFAULT_IP_ADDRESS); int port = Utils.getTaskServicePort(properties); boolean connected = client.connect(host, port); if (!connected) { throw new IllegalArgumentException("Could not connect task client " + strategy + "(" + host + ":" + port + ")");
private TaskClient getTaskClient() { if (client == null) { String transportType = "unknown"; if (transport == 0) { transportType = "Apache Mina"; client = new TaskClient(new MinaTaskClientConnector("Eclipse-Mina", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener()))); } else if (transport == 1) { transportType = "HornetQ"; client = new TaskClient(new HornetQTaskClientConnector("Eclipse-HornetQ", new HornetQTaskClientHandler(SystemEventListenerFactory.getSystemEventListener()))); } boolean connected = client.connect(ipAddress, port); if (!connected) { showMessage("Could not connect to task server: " + ipAddress + " [port " + port + "] transport " + transportType); client = null; } } return client; }