1   /**
2    * 
3    */
4   package org.votech.plastic.managers;
5   
6   /**
7    * This is the simplest possible application using the {@link org.votech.plastic.managers.PlasticConnectionManager} class
8    * to handle the plastic hub.  It registers as an application understanding no messages, sends no messages,
9    * and listens for no messages.  Nevertheless, it is a real Plastic application and will appear as registered
10   * with the hub.  For a more realistic application see {@link org.votech.plastic.managers.ExampleApplication}.
11   * Requires plastic.jar and its dependencies: see http://plastic.sourceforge.net/plastic
12   * @since 0.6.0
13   * 
14   * @author jdt
15   *
16   */
17  public class SimplestExampleApplication {
18      public SimplestExampleApplication() {
19          // Create a manager with no message handler (for incoming messages), which doesn't connect on creation
20          // but will attempt to reconnect every 1000 milliseconds if the connection drops after connection.
21          PlasticConnectionManager manager = new PlasticConnectionManagerImpl("Trivial",null,false,1000);
22          manager.connect(); //connect to the hub, blocking.  If you don't want to block use connectWhenReady()
23      }
24      
25      public static void main(String[] args) {
26          new SimplestExampleApplication();
27      }
28      
29  }