com.espertech.esper.client
Interface EPServiceProvider

All Known Subinterfaces:
EPServiceProviderSPI
All Known Implementing Classes:
EPServiceProviderImpl

public interface EPServiceProvider

This class provides access to the EPRuntime and EPAdministrator implementations.


Method Summary
 void addServiceStateListener(EPServiceStateListener listener)
          Add a listener to service provider state changes that receives a before-destroy event.
 void addStatementStateListener(EPStatementStateListener listener)
          Add a listener to statement state changes that receives statement-level events.
 void destroy()
          Destroys the service.
 javax.naming.Context getContext()
          Provides naming context for public named objects.
 java.util.concurrent.locks.ReadWriteLock getEngineInstanceWideLock()
          Returns the engine-instance global read-write lock.
 EPAdministrator getEPAdministrator()
          Returns a class instance of EPAdministrator.
 EPRuntime getEPRuntime()
          Returns a class instance of EPRuntime.
 EPServiceProviderIsolated getEPServiceIsolated(java.lang.String name)
          Returns the isolated service provider for that name, creating an isolated service if the name is a new name, or returning an existing isolated service for an existing name.
 java.lang.String[] getEPServiceIsolatedNames()
          Returns the names of isolated service providers currently allocated.
 java.lang.String getURI()
          Returns the provider URI, or "default" if this is the default provider.
 void initialize()
          Frees any resources associated with this engine instance, and leaves the engine instance ready for further use.
 boolean isDestroyed()
          Returns true if the service is in destroyed state, or false if not.
 void removeAllServiceStateListeners()
          Remove all listeners to service provider state changes.
 void removeAllStatementStateListeners()
          Remove all listeners to statement state changes.
 boolean removeServiceStateListener(EPServiceStateListener listener)
          Removate a listener to service provider state changes.
 boolean removeStatementStateListener(EPStatementStateListener listener)
          Removate a listener to statement state changes.
 

Method Detail

getEPRuntime

EPRuntime getEPRuntime()
                       throws EPServiceDestroyedException
Returns a class instance of EPRuntime.

If the engine instance is destroyed, the behavior is undefined and a NullPointerException is possible.

Returns:
an instance of EPRuntime
Throws:
EPServiceDestroyedException - thrown when the engine instance has been destroyed

getEPAdministrator

EPAdministrator getEPAdministrator()
                                   throws EPServiceDestroyedException
Returns a class instance of EPAdministrator.

If the engine instance is destroyed, the behavior is undefined and a NullPointerException is possible.

Returns:
an instance of EPAdministrator
Throws:
EPServiceDestroyedException - thrown when the engine instance has been destroyed

getContext

javax.naming.Context getContext()
                                throws EPServiceDestroyedException
Provides naming context for public named objects.

An extension point designed for use by input and output adapters as well as other extension services.

Returns:
naming context providing name-to-object bindings
Throws:
EPServiceDestroyedException - thrown when the engine instance has been destroyed

initialize

void initialize()
Frees any resources associated with this engine instance, and leaves the engine instance ready for further use.

Do not use the EPAdministrator administrative and EPRuntime runtime instances obtained before the initialize (including related services such as configuration, module management, etc.). Your application must obtain new administrative and runtime instances.

Retains the existing configuration of the engine instance but forgets any runtime configuration changes.

Stops and destroys any existing statement resources such as filters, patterns, expressions, views.


getURI

java.lang.String getURI()
Returns the provider URI, or "default" if this is the default provider.

Returns:
provider URI

destroy

void destroy()
Destroys the service.

Releases any resources held by the service. The service enteres a state in which operations provided by administrative and runtime interfaces originiated by the service are not guaranteed to operate properly.

Removes the service URI from the known URIs. Allows configuration to change for the instance.

When destroying a service instance your application must make sure that threads that are sending events into the service have completed their work. More generally, the service should not be currently in use during or after the destroy operation.


isDestroyed

boolean isDestroyed()
Returns true if the service is in destroyed state, or false if not.

Returns:
indicator whether the service has been destroyed

addServiceStateListener

void addServiceStateListener(EPServiceStateListener listener)
Add a listener to service provider state changes that receives a before-destroy event. The listener collection applies set-semantics.

Parameters:
listener - to add

removeServiceStateListener

boolean removeServiceStateListener(EPServiceStateListener listener)
Removate a listener to service provider state changes.

Parameters:
listener - to remove
Returns:
true to indicate the listener was removed, or fals

removeAllServiceStateListeners

void removeAllServiceStateListeners()
Remove all listeners to service provider state changes.


addStatementStateListener

void addStatementStateListener(EPStatementStateListener listener)
Add a listener to statement state changes that receives statement-level events. The listener collection applies set-semantics.

Parameters:
listener - to add

removeStatementStateListener

boolean removeStatementStateListener(EPStatementStateListener listener)
Removate a listener to statement state changes.

Parameters:
listener - to remove
Returns:
true to indicate the listener was removed, or fals

removeAllStatementStateListeners

void removeAllStatementStateListeners()
Remove all listeners to statement state changes.


getEPServiceIsolated

EPServiceProviderIsolated getEPServiceIsolated(java.lang.String name)
                                               throws EPServiceDestroyedException,
                                                      EPServiceNotAllowedException
Returns the isolated service provider for that name, creating an isolated service if the name is a new name, or returning an existing isolated service for an existing name.

Note: Requires configuration setting.

Parameters:
name - to return isolated service for
Returns:
isolated service
Throws:
EPServiceDestroyedException - thrown when the engine instance has been destroyed
EPServiceNotAllowedException - thrown when the engine configuration does not allow isolated service providers

getEPServiceIsolatedNames

java.lang.String[] getEPServiceIsolatedNames()
Returns the names of isolated service providers currently allocated.

Returns:
isolated service provider names

getEngineInstanceWideLock

java.util.concurrent.locks.ReadWriteLock getEngineInstanceWideLock()
Returns the engine-instance global read-write lock. The EPRuntime.sendEvent(java.lang.Object) method takes a read lock. The EPAdministrator.createEPL(java.lang.String) methods take a write lock.

Returns:
engine instance global read-write lock

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com