org.openanzo.model.embedded
Class EmbeddedServiceBase

java.lang.Object
  extended by org.openanzo.model.embedded.EmbeddedServiceBase

public class EmbeddedServiceBase
extends java.lang.Object

Enables an Anzo client to run a embedded Model Service as a library within the client's JVM.

Author:
Joe Betz, Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
EmbeddedServiceBase(ModelServiceApi modelServiceApi, java.util.Properties properties)
          Create a new EmbeddedServiceBase with given configuration properties
EmbeddedServiceBase(java.util.Properties properties)
          Create a new EmbeddedServiceBase with given configuration properties
 
Method Summary
 void close()
          Close this service, if it is the last reference, then unregister the reset listener
 int decrementUsage()
          Decrement the usage count
static EmbeddedServiceBase getInstance(java.lang.Object parent, java.util.Properties props)
          Get an instance of the base service.
 java.lang.String getServicePassword()
          Get the user's password for the current thread which this service will use to authenticate
 java.lang.String getServiceUser()
          Get the userId for the current thread which this service will use to authenticate
 int incrementUsage()
          Increment the usage count
 boolean isClosed()
          Get if this service is closed
 void setServicePassword(java.lang.String password)
          Set the user's password for the current thread which this service will use to authenticate
 void setServiceUser(java.lang.String user)
          Set the userId for the current thread which this service will use to authenticate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedServiceBase

public EmbeddedServiceBase(java.util.Properties properties)
                    throws AnzoException
Create a new EmbeddedServiceBase with given configuration properties

Parameters:
properties - Configuration properties
Throws:
AnzoException

EmbeddedServiceBase

public EmbeddedServiceBase(ModelServiceApi modelServiceApi,
                           java.util.Properties properties)
                    throws AnzoException
Create a new EmbeddedServiceBase with given configuration properties

Parameters:
modelServiceApi - the api which this service uses
properties - Configuration properties
Throws:
AnzoException
Method Detail

getInstance

public static EmbeddedServiceBase getInstance(java.lang.Object parent,
                                              java.util.Properties props)
Get an instance of the base service. If a parent has already gotten an instance of the base service, return that same object, else create a new instance.

Parameters:
parent - The object creating this service
props - The configuration properties for this service
Returns:
an instance of the base service

close

public void close()
Close this service, if it is the last reference, then unregister the reset listener


setServiceUser

public void setServiceUser(java.lang.String user)
Set the userId for the current thread which this service will use to authenticate

Parameters:
user - userId for the current thread which this service will use to authenticate

getServiceUser

public java.lang.String getServiceUser()
Get the userId for the current thread which this service will use to authenticate

Returns:
the userId for the current thread which this service will use to authenticate

getServicePassword

public java.lang.String getServicePassword()
Get the user's password for the current thread which this service will use to authenticate

Returns:
the user's password for the current thread which this service will use to authenticate

setServicePassword

public void setServicePassword(java.lang.String password)
Set the user's password for the current thread which this service will use to authenticate

Parameters:
password - user's password for the current thread which this service will use to authenticate

isClosed

public boolean isClosed()
Get if this service is closed

Returns:
if this service is closed

incrementUsage

public int incrementUsage()
Increment the usage count

Returns:
the incremented usage count

decrementUsage

public int decrementUsage()
Decrement the usage count

Returns:
the Decrement usage count


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.