org.netbeans.modules.j2ee.persistenceapi/1 1.0.20

org.netbeans.modules.j2ee.persistence.spi.support
Class PersistenceScopesHelper

java.lang.Object
  extended by org.netbeans.modules.j2ee.persistence.spi.support.PersistenceScopesHelper

public final class PersistenceScopesHelper
extends Object

Helper class for implementing PersistenceScopesProvider. It creates and maintains a PersistenceScopes instance containing a single PersistenceScope or an empty array of PersistenceScope depending on whether the persistence.xml file corresponding to that PersistenceScope exists or not, firing property changes as the persistence.xml file is created/deleted.


Constructor Summary
PersistenceScopesHelper()
           
 
Method Summary
 PersistenceScopes getPersistenceScopes()
          Returns the PersistenceScopes created by this helper.
 void changePersistenceScope(PersistenceScope newPersistenceScope, File newPersistenceXml)
          Call this method in order to change the persistence scope returned by the PersistenceScopes instance returned by getPersistenceScopes() or the corresponding persistence.xml file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceScopesHelper

public PersistenceScopesHelper()
Method Detail

changePersistenceScope

public void changePersistenceScope(PersistenceScope newPersistenceScope,
                                   File newPersistenceXml)
Call this method in order to change the persistence scope returned by the PersistenceScopes instance returned by getPersistenceScopes() or the corresponding persistence.xml file.

Parameters:
newPersistenceScope - the new persistence scope; can be null, but in this case the newPersistenceXml parameter must be null too.
newPersistenceXml - the new persistence.xml file; can be null.
Throws:
IllegalArgumentException - if newPersistenceScope is null and newPersistenceXml is not.

getPersistenceScopes

public PersistenceScopes getPersistenceScopes()
Returns the PersistenceScopes created by this helper. Usually an implementor of PersistenceScopesProvider will delegate its getPersistenceScopes method to this method.

Returns:
a PersistenceScopes instance; never null.

org.netbeans.modules.j2ee.persistenceapi/1 1.0.20

Built on August 9 2006.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.