org.ow2.petals.registry.core
Class AbstractRegistry

java.lang.Object
  extended by org.ow2.petals.registry.core.AbstractRegistry
All Implemented Interfaces:
org.ow2.petals.registry.api.lifecycle.LifeCycle, org.ow2.petals.registry.api.Registry
Direct Known Subclasses:
AbstractLocalRegistry

public abstract class AbstractRegistry
extends java.lang.Object
implements org.ow2.petals.registry.api.Registry

This class is used to handle resources and lifecycle. A resource can only be handled when the lifecycle is in started state.

Author:
Christophe HAMERLING - eBM WebSourcing

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.petals.registry.api.lifecycle.LifeCycle
org.ow2.petals.registry.api.lifecycle.LifeCycle.STATE
 
Field Summary
protected  org.ow2.petals.registry.api.context.Context context
           
protected  org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle
           
protected  org.apache.commons.logging.Log logger
           
protected  java.lang.String name
           
 
Constructor Summary
AbstractRegistry()
          Creates a new instance of AbstractRegistry
 
Method Summary
 boolean delete(java.lang.String key, boolean b)
           
abstract  boolean doDelete(java.lang.String key, boolean b)
           
abstract  org.ow2.petals.registry.api.Resource doGet(java.lang.String key, boolean b)
           
abstract  java.util.List<org.ow2.petals.registry.api.Resource> doGetAll(java.lang.String key, boolean b)
           
abstract  boolean doPut(java.lang.String key, org.ow2.petals.registry.api.Resource resource, boolean b)
           
 org.ow2.petals.registry.api.Resource get(java.lang.String key, boolean b)
           
 java.util.List<org.ow2.petals.registry.api.Resource> getAll(java.lang.String path, boolean b)
           
 org.ow2.petals.registry.api.context.Context getContext()
           
 java.lang.String getName()
           
 org.ow2.petals.registry.api.lifecycle.LifeCycle.STATE getState()
           
 void init(org.ow2.petals.registry.api.context.Context context)
           
 boolean isInitialized()
           
 boolean isNotInitialized()
           
 boolean isRunning()
           
 boolean isStarted()
           
 boolean isStopped()
           
 boolean put(java.lang.String key, org.ow2.petals.registry.api.Resource resource, boolean b)
           
 void setContext(org.ow2.petals.registry.api.context.Context context)
           
protected  void setLifeCycle(org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle)
           
 void setName(java.lang.String name)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lifeCycle

protected org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle

name

protected java.lang.String name

context

protected org.ow2.petals.registry.api.context.Context context

logger

protected org.apache.commons.logging.Log logger
Constructor Detail

AbstractRegistry

public AbstractRegistry()
Creates a new instance of AbstractRegistry

Method Detail

delete

public final boolean delete(java.lang.String key,
                            boolean b)
                     throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doDelete

public abstract boolean doDelete(java.lang.String key,
                                 boolean b)
                          throws org.ow2.petals.registry.api.exception.RegistryException
Parameters:
uuid -
Throws:
org.ow2.petals.registry.api.exception.RegistryException

get

public final org.ow2.petals.registry.api.Resource get(java.lang.String key,
                                                      boolean b)
                                               throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

getAll

public final java.util.List<org.ow2.petals.registry.api.Resource> getAll(java.lang.String path,
                                                                         boolean b)
                                                                  throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

setName

public void setName(java.lang.String name)
Specified by:
setName in interface org.ow2.petals.registry.api.Registry

doGet

public abstract org.ow2.petals.registry.api.Resource doGet(java.lang.String key,
                                                           boolean b)
                                                    throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doGetAll

public abstract java.util.List<org.ow2.petals.registry.api.Resource> doGetAll(java.lang.String key,
                                                                              boolean b)
                                                                       throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

put

public final boolean put(java.lang.String key,
                         org.ow2.petals.registry.api.Resource resource,
                         boolean b)
                  throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doPut

public abstract boolean doPut(java.lang.String key,
                              org.ow2.petals.registry.api.Resource resource,
                              boolean b)
                       throws org.ow2.petals.registry.api.exception.RegistryException
Parameters:
resource -
Returns:
Throws:
org.ow2.petals.registry.api.exception.RegistryException

setLifeCycle

protected void setLifeCycle(org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle)
Parameters:
lifeCycle -

getState

public org.ow2.petals.registry.api.lifecycle.LifeCycle.STATE getState()
Specified by:
getState in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

init

public void init(org.ow2.petals.registry.api.context.Context context)
          throws org.ow2.petals.registry.api.exception.LifeCycleException
Specified by:
init in interface org.ow2.petals.registry.api.lifecycle.LifeCycle
Throws:
org.ow2.petals.registry.api.exception.LifeCycleException

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isNotInitialized

public boolean isNotInitialized()
Specified by:
isNotInitialized in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isStarted

public boolean isStarted()
Specified by:
isStarted in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isStopped

public boolean isStopped()
Specified by:
isStopped in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

start

public void start()
           throws org.ow2.petals.registry.api.exception.LifeCycleException
Specified by:
start in interface org.ow2.petals.registry.api.lifecycle.LifeCycle
Throws:
org.ow2.petals.registry.api.exception.LifeCycleException

stop

public void stop()
          throws org.ow2.petals.registry.api.exception.LifeCycleException
Specified by:
stop in interface org.ow2.petals.registry.api.lifecycle.LifeCycle
Throws:
org.ow2.petals.registry.api.exception.LifeCycleException

getName

public java.lang.String getName()
Specified by:
getName in interface org.ow2.petals.registry.api.Registry

getContext

public org.ow2.petals.registry.api.context.Context getContext()
Returns:
the context

setContext

public void setContext(org.ow2.petals.registry.api.context.Context context)


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.