Creating an Engine Client in Java

This section describes how to create an engine client in Java in Sybase CEP.

First you create an instance of a client to connect to and communicate with an instance of Sybase CEP Server, as part of the constructor:

engineClient = SDK.getEngineClientFactory().newEngineClient(
   serverUrl, CredentialsFactory.newCredentials(userName, 
   password));

This line creates a new engine client to run operations on a particular Sybase CEP Server process. The newEngineClient method takes parameters specifying the HTTP URL of the host running Sybase CEP Server (such as http://mymachine.mycompany.com:6789 ) and the authentication credentials to use when connecting with a server that requires authentication. The example defaults to a server process on the local host with no authentication required. When you run any of the Java 1.5 examples, all of which contain this code, you can pass a server URL, account name, and password on the command line to override the default behavior, if needed for your environment.