src/main/java/pityoulish/sockets/follow/Main.java
public final static void main(String[] args)
    throws Exception
  {
    LogConfig.configure(Main.class);
    LOGGER.log(Level.INFO, "starting Message Board follower");

    // rb and rp define the binary format, in this case TLV
    // They could be replaced by a JSON implementation, for example.
    RequestBuilder rb = new TLVRequestBuilderImpl();
    ResponseParser rp = new TLVResponseParserImpl();

    // The visitor encapsulates application logic for processing the response.
    // It doesn't know about the binary format, but about response elements.
    TrackingVisitorImpl tvi = new TrackingVisitorImpl();

    // sbh connects to the backend, mbch sends requests and receives messages
    SocketBackendHandler sbh = new SocketBackendHandlerImpl();
    MsgBoardClientHandler mbch =
      new MsgBoardClientHandlerImpl(sbh, rb, rp, tvi);

    // ftbh interprets command-line arguments
    FollowTheBoardHandler ftbh = new FollowTheBoardHandler(mbch, tvi);
    ArgsInterpreter ai = new ArgsInterpreter(sbh, ftbh.getCommandName(), ftbh);

    int status = ai.handle(args);
    System.exit(status);
  }
/**
   * Main entry point.
   *
   * @param args        the command-line arguments
   *
   * @throws Exception  in case of a problem
   */
Main entry point.
@param args        the command-line arguments

@throws Exception  in case of a problem
Main entry point . @param args the command - line arguments @throws Exception in case of a problem
public final static void main(String[] args)
    throws Exception
  {
    LogConfig.configure(Main.class);
    LOGGER.log(Level.INFO, "starting Message Board follower");
    RequestBuilder rb = new TLVRequestBuilderImpl();
    ResponseParser rp = new TLVResponseParserImpl();
    TrackingVisitorImpl tvi = new TrackingVisitorImpl();
    SocketBackendHandler sbh = new SocketBackendHandlerImpl();
    MsgBoardClientHandler mbch =
      new MsgBoardClientHandlerImpl(sbh, rb, rp, tvi);
    FollowTheBoardHandler ftbh = new FollowTheBoardHandler(mbch, tvi);
    ArgsInterpreter ai = new ArgsInterpreter(sbh, ftbh.getCommandName(), ftbh);
    int status = ai.handle(args);
    System.exit(status);
  }
public final static void main ( String [ ] args ) throws Exception { LogConfig . configure ( Main . class ) ; LOGGER . log ( Level . INFO , "starting Message Board follower" ) ; RequestBuilder rb = new TLVRequestBuilderImpl ( ) ; ResponseParser rp = new TLVResponseParserImpl ( ) ; TrackingVisitorImpl tvi = new TrackingVisitorImpl ( ) ; SocketBackendHandler sbh = new SocketBackendHandlerImpl ( ) ; MsgBoardClientHandler mbch = new MsgBoardClientHandlerImpl ( sbh , rb , rp , tvi ) ; FollowTheBoardHandler ftbh = new FollowTheBoardHandler ( mbch , tvi ) ; ArgsInterpreter ai = new ArgsInterpreter ( sbh , ftbh . getCommandName ( ) , ftbh ) ; int status = ai . handle ( args ) ; System . exit ( status ) ; }
Main entry point.
Main entry point .
// rb and rp define the binary format, in this case TLV // They could be replaced by a JSON implementation, for example. // The visitor encapsulates application logic for processing the response. // It doesn't know about the binary format, but about response elements. // sbh connects to the backend, mbch sends requests and receives messages // ftbh interprets command-line arguments