org.apache.gora.persistency.ws.impl
Class BeanFactoryWSImpl<K,T extends Persistent>

java.lang.Object
  extended by org.apache.gora.persistency.ws.impl.BeanFactoryWSImpl<K,T>
All Implemented Interfaces:
BeanFactory<K,T>

public class BeanFactoryWSImpl<K,T extends Persistent>
extends Object
implements BeanFactory<K,T>

A default implementation of the BeanFactory interface. Constructs the keys using by reflection, Persistent objects by calling Persistent.newInstance(org.apache.gora.persistency.StateManager).


Constructor Summary
BeanFactoryWSImpl(Class<K> keyClass, Class<T> persistentClass)
          Constructor
 
Method Summary
 K getCachedKey()
          Returns an instance of the key object to be used to access static fields of the object.
 T getCachedPersistent()
          Returns an instance of the Persistent object to be used to access static fields of the object.
 Class<K> getKeyClass()
          Returns the key class
 Class<T> getPersistentClass()
          Returns the persistent class
 boolean isKeyPersistent()
          Returns if a key is an object of a persistent class
 K newKey()
          Constructs a new instance of the key class
 T newPersistent()
          Constructs a new instance of the Persistent class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanFactoryWSImpl

public BeanFactoryWSImpl(Class<K> keyClass,
                         Class<T> persistentClass)
Constructor

Parameters:
keyClass -
persistentClass -
Method Detail

newKey

public K newKey()
         throws Exception
Description copied from interface: BeanFactory
Constructs a new instance of the key class

Specified by:
newKey in interface BeanFactory<K,T extends Persistent>
Returns:
a new instance of the key class
Throws:
Exception

newPersistent

public T newPersistent()
Description copied from interface: BeanFactory
Constructs a new instance of the Persistent class

Specified by:
newPersistent in interface BeanFactory<K,T extends Persistent>
Returns:
a new instance of the Persistent class

getCachedKey

public K getCachedKey()
Description copied from interface: BeanFactory
Returns an instance of the key object to be used to access static fields of the object. Returned object MUST be treated as read-only. No fields other than the static fields of the object should be assumed to be readable.

Specified by:
getCachedKey in interface BeanFactory<K,T extends Persistent>
Returns:
a cached instance of the key object

getCachedPersistent

public T getCachedPersistent()
Description copied from interface: BeanFactory
Returns an instance of the Persistent object to be used to access static fields of the object. Returned object MUST be treated as read-only. No fields other than the static fields of the object should be assumed to be readable.

Specified by:
getCachedPersistent in interface BeanFactory<K,T extends Persistent>
Returns:
a cached instance of the Persistent object

getKeyClass

public Class<K> getKeyClass()
Description copied from interface: BeanFactory
Returns the key class

Specified by:
getKeyClass in interface BeanFactory<K,T extends Persistent>
Returns:
the key class

getPersistentClass

public Class<T> getPersistentClass()
Description copied from interface: BeanFactory
Returns the persistent class

Specified by:
getPersistentClass in interface BeanFactory<K,T extends Persistent>
Returns:
the persistent class

isKeyPersistent

public boolean isKeyPersistent()
Returns if a key is an object of a persistent class

Returns:
True if it is or false if it is not


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.