org.apache.geronimo.gbean.runtime
Class AbstractGBeanReference

java.lang.Object
  extended byorg.apache.geronimo.gbean.runtime.AbstractGBeanReference
All Implemented Interfaces:
GBeanReference
Direct Known Subclasses:
GBeanCollectionReference, GBeanSingleReference

public abstract class AbstractGBeanReference
extends java.lang.Object
implements GBeanReference

Version:
$Rev$ $Date$

Field Summary
private  DependencyManager dependencyManager
          The dependency manager of the kernel.
private  GBeanInstance gbeanInstance
          The GBeanInstance to which this reference belongs.
private  boolean isOnline
          is this reference online
private  Kernel kernel
          The kernel to which the reference is bound.
private  LifecycleListener listener
          Our listener for lifecycle events
private  java.lang.String name
          Name of this reference.
private  java.util.Set patterns
          The target objectName patterns to watch for a connection.
private  java.lang.Object proxy
          Proxy for this reference
private  java.lang.Class proxyType
          Proxy type which is injected into the GBeanInstance.
private  GReferenceInfo referenceInfo
          The metadata for this reference
private  java.lang.Class referenceType
          Interface this GBeanInstance uses to refer to the other.
private  MethodInvoker setInvoker
          The method that will be called to set the attribute value.
private  java.util.Set targets
          Current set of targets
 
Constructor Summary
AbstractGBeanReference(GBeanInstance gbeanInstance, GReferenceInfo referenceInfo, Kernel kernel, DependencyManager dependencyManager)
           
 
Method Summary
protected  void addTarget(javax.management.ObjectName objectName)
           
protected abstract  LifecycleListener createLifecycleListener()
           
protected  DependencyManager getDependencyManager()
           
protected  java.lang.String getDescription()
           
 GBeanInstance getGBeanInstance()
           
protected  Kernel getKernel()
           
 java.lang.String getName()
           
 java.util.Set getPatterns()
           
 java.lang.Object getProxy()
           
 java.lang.Class getProxyType()
           
 GReferenceInfo getReferenceInfo()
           
 java.lang.Class getReferenceType()
           
protected  java.util.Set getTargets()
           
 void inject(java.lang.Object target)
           
private  boolean isRunning(Kernel kernel, javax.management.ObjectName objectName)
          Is the component in the Running state
 void offline()
           
 void online()
           
protected  void removeTarget(javax.management.ObjectName objectName)
           
 void setPatterns(java.util.Set patterns)
           
protected  void setProxy(java.lang.Object proxy)
           
protected abstract  void targetAdded(javax.management.ObjectName target)
           
protected abstract  void targetRemoved(javax.management.ObjectName target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.geronimo.gbean.runtime.GBeanReference
start, stop
 

Field Detail

name

private final java.lang.String name
Name of this reference.


referenceType

private final java.lang.Class referenceType
Interface this GBeanInstance uses to refer to the other.


proxyType

private final java.lang.Class proxyType
Proxy type which is injected into the GBeanInstance.


gbeanInstance

private final GBeanInstance gbeanInstance
The GBeanInstance to which this reference belongs.


setInvoker

private final MethodInvoker setInvoker
The method that will be called to set the attribute value. If null, the value will be set with a constructor argument


patterns

private java.util.Set patterns
The target objectName patterns to watch for a connection.


listener

private final LifecycleListener listener
Our listener for lifecycle events


targets

private final java.util.Set targets
Current set of targets


referenceInfo

private final GReferenceInfo referenceInfo
The metadata for this reference


kernel

private final Kernel kernel
The kernel to which the reference is bound.


dependencyManager

private final DependencyManager dependencyManager
The dependency manager of the kernel.


proxy

private java.lang.Object proxy
Proxy for this reference


isOnline

private boolean isOnline
is this reference online

Constructor Detail

AbstractGBeanReference

public AbstractGBeanReference(GBeanInstance gbeanInstance,
                              GReferenceInfo referenceInfo,
                              Kernel kernel,
                              DependencyManager dependencyManager)
                       throws InvalidConfigurationException
Method Detail

createLifecycleListener

protected abstract LifecycleListener createLifecycleListener()

targetAdded

protected abstract void targetAdded(javax.management.ObjectName target)

targetRemoved

protected abstract void targetRemoved(javax.management.ObjectName target)

getKernel

protected final Kernel getKernel()

getDependencyManager

protected final DependencyManager getDependencyManager()

getGBeanInstance

public final GBeanInstance getGBeanInstance()

getName

public final java.lang.String getName()
Specified by:
getName in interface GBeanReference

getReferenceInfo

public final GReferenceInfo getReferenceInfo()
Specified by:
getReferenceInfo in interface GBeanReference

getReferenceType

public final java.lang.Class getReferenceType()
Specified by:
getReferenceType in interface GBeanReference

getProxyType

public final java.lang.Class getProxyType()
Specified by:
getProxyType in interface GBeanReference

getProxy

public final java.lang.Object getProxy()
Specified by:
getProxy in interface GBeanReference

setProxy

protected final void setProxy(java.lang.Object proxy)

getPatterns

public final java.util.Set getPatterns()
Specified by:
getPatterns in interface GBeanReference

setPatterns

public final void setPatterns(java.util.Set patterns)
Specified by:
setPatterns in interface GBeanReference

online

public final void online()
Specified by:
online in interface GBeanReference

offline

public final void offline()
Specified by:
offline in interface GBeanReference

getTargets

protected final java.util.Set getTargets()

addTarget

protected final void addTarget(javax.management.ObjectName objectName)

removeTarget

protected final void removeTarget(javax.management.ObjectName objectName)

inject

public final void inject(java.lang.Object target)
                  throws java.lang.Exception
Specified by:
inject in interface GBeanReference
Throws:
java.lang.Exception

isRunning

private boolean isRunning(Kernel kernel,
                          javax.management.ObjectName objectName)
Is the component in the Running state

Parameters:
objectName - name of the component to check
Returns:
true if the component is running; false otherwise

getDescription

protected final java.lang.String getDescription()


Copyright © 2005 Apache Software Foundation. All Rights Reserved.