SHARE
TWEET

ClientTcp.java

olegtikhonov Apr 1st, 2013 127 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package org.example.tcpclient;
  2.  
  3. import org.springframework.context.support.AbstractApplicationContext;
  4. import org.springframework.context.support.ClassPathXmlApplicationContext;
  5.  
  6. public class ClientTcp {
  7.  
  8.         /**
  9.          * @param args
  10.          */
  11.         public static void main(String[] args) {
  12.                  /* Spring Integration context used to get desirable beans. */
  13.         AbstractApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"client-config.xml"}, false);
  14.         context.refresh();
  15.         context.registerShutdownHook();
  16.        
  17.         TcpClientService service = context.getBean("client", TcpClientService.class);
  18.  
  19.         service.send("GIMMY");
  20.         }
  21. }
RAW Paste Data
Top