info.magnolia.objectfactory
Class ObservedComponentFactory<T>

java.lang.Object
  extended by info.magnolia.objectfactory.ObservedComponentFactory<T>
Type Parameters:
T - the type of component this factory instantiates.
All Implemented Interfaces:
ComponentFactory<T>, javax.jcr.observation.EventListener
Direct Known Subclasses:
FactoryUtil.ObservedObjectFactory, IPSecurityManagerImpl.InstanceFactory, ServerConfiguration.InstanceFactory

public class ObservedComponentFactory<T>
extends java.lang.Object
implements ComponentFactory<T>, javax.jcr.observation.EventListener

Generic observed singleton factory.

Version:
$Id: $
Author:
philipp

Field Summary
protected  java.lang.Class<T> interf
          Deprecated. since 4.3 - this should be private - use getComponentType() instead. (rename to "type" once made private)
protected  T observedObject
          Deprecated. since 4.3 - this should be private - use getObservedObject() instead.
 
Constructor Summary
ObservedComponentFactory(java.lang.String repository, java.lang.String path, java.lang.Class<T> type)
           
 
Method Summary
protected  java.lang.Class<T> getComponentType()
           
protected  Content2BeanTransformer getContent2BeanTransformer()
           
 T getObservedObject()
          Deprecated. since 4.3 - DefaultComponentProvider.newInstance(Class) returns a proxy of the observed object instead of this factory, so this method shouldn't be needed publicly.
protected  void instantiateDefault()
           
protected  boolean isConcrete(java.lang.Class<?> clazz)
           
protected  void load()
           
 T newInstance()
           
 void onEvent(javax.jcr.observation.EventIterator events)
           
protected  void onRegister(Content node)
           
protected  void reload()
           
protected  void startObservation(java.lang.String handle)
           
 java.lang.String toString()
           
protected  T transformNode(Content node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

interf

protected final java.lang.Class<T> interf
Deprecated. since 4.3 - this should be private - use getComponentType() instead. (rename to "type" once made private)

observedObject

protected T observedObject
Deprecated. since 4.3 - this should be private - use getObservedObject() instead.
The object delivered by this factory.

Constructor Detail

ObservedComponentFactory

public ObservedComponentFactory(java.lang.String repository,
                                java.lang.String path,
                                java.lang.Class<T> type)
Method Detail

newInstance

public T newInstance()
Specified by:
newInstance in interface ComponentFactory<T>

startObservation

protected void startObservation(java.lang.String handle)

onEvent

public void onEvent(javax.jcr.observation.EventIterator events)
Specified by:
onEvent in interface javax.jcr.observation.EventListener

reload

protected void reload()

load

protected void load()

instantiateDefault

protected void instantiateDefault()

isConcrete

protected boolean isConcrete(java.lang.Class<?> clazz)

onRegister

protected void onRegister(Content node)

transformNode

protected T transformNode(Content node)
                   throws Content2BeanException
Throws:
Content2BeanException

getContent2BeanTransformer

protected Content2BeanTransformer getContent2BeanTransformer()

getComponentType

protected java.lang.Class<T> getComponentType()

getObservedObject

public T getObservedObject()
Deprecated. since 4.3 - DefaultComponentProvider.newInstance(Class) returns a proxy of the observed object instead of this factory, so this method shouldn't be needed publicly.

Returns the latest converted object observed by this factory. Since 4.3, if you are using DefaultClassFactory, calling this shouldn't be needed, newInstance() returned a proxy, so you'll always see this object.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.