Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.jdeveloper.library
Class JLibraryManager

java.lang.Object
  extended by oracle.jdeveloper.library.JLibraryManager
All Implemented Interfaces:
Addin, ShutdownHook, DependableRecognizer, Subject

public final class JLibraryManager
extends java.lang.Object
implements Addin, ShutdownHook, Subject, DependableRecognizer


Field Summary
static java.lang.String JDK_EXTENSION
           
static java.lang.String LEGACY_LIBRARY_FILE
          Deprecated. library.ini format no longer supported.
static int LIBRARY_ADDED
           
static java.lang.String LIBRARY_EXTENSION
           
static java.lang.String LIBRARY_LIST_FILE
           
static int LIBRARY_REMOVED
           
static java.lang.String SETTINGS_KEY
           
 
Constructor Summary
JLibraryManager()
           
 
Method Summary
 void addLibraryChangeListener(ProjectLibraryChangeListener libraryChangeListener)
           
static JLibraryList addLibraryList(java.net.URL url)
           
 void attach(Observer observer)
          Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes.
 boolean canShutdown()
          This method is called by the IDE to confirm that the ide can shutdown.
 Dependable create(Element source, Folder sourceOwner)
          Creates a Dependable that encapsulates the source object.
static JDK createJDK(java.lang.Object id, java.net.URL javaExe, MutableLibraryList list)
           
static JLibrary createLibrary(java.lang.Object id, MutableLibraryList list)
           
 void detach(Observer observer)
          Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes.
static JDK findJDK(java.lang.Object id)
           
static JDK findJDK(VersionNumber num, JDK[] jdks)
           
static JDK findJDKMatch(java.lang.Object id, VersionNumber num)
           
static JLibrary findLibrary(java.lang.Object id)
           
static AddinLibraryList getAddinLibraries()
           
static LibraryList[] getAllLibraryLists()
          Returns all lists last preserved as the working set.
static JDK getDefaultJDK()
           
 java.util.Collection<DynamicLibraryProvider> getDynamicLibraryProviders()
          Returns an (immutable) collection of all registered dynamic library providers.
static JLibraryManager getInstance()
          Retrieves the single JLibraryManager instance.
static java.util.List getJDKs()
          Deprecated. Concept of finite library lists from which to gather JDKs no longer exists. Now returns only what can be found within the last working set of library lists.
static java.util.List getLibraries()
          Deprecated. Concept of finite library lists from which to gather libraries no longer exists. Now returns only what can be found within the last working set of library lists.
static JLibraryList getUserLibraries()
           
 void initialize()
          Invoked by the AddinManager after the instance of the Addin is instantiated.
 void notifyObservers(java.lang.Object subject, UpdateMessage change)
          Notifies all observers that the state of the subject has changed.
 void projectLibrariesChanged(Project project, java.util.Set<java.net.URL> modifiedJars, java.util.Set<java.net.URL> addedJars, java.util.Set<java.net.URL> deletedJars)
           
 boolean recognize(Element source)
          Returns true if this dependable factory recognizes the specified source object.
static void registerDerivedLibrary(java.lang.Class key, java.lang.Class cls)
          Call this method to register a DerivedLibrary class.
 void registerDynamicLibraryProvider(DynamicLibraryProvider provider)
          Registers a dynamic library provider with the library manager.
static void removeJDK(JDK jdk, MutableLibraryList list)
           
static void removeLibrary(JLibrary lib, MutableLibraryList list)
           
 void removeLibraryChangeListener(ProjectLibraryChangeListener libraryChangeListener)
           
static boolean removeLibraryList(LibraryList list)
           
 void shutdown()
          Called on all shutdown hooks in the order they were registered when the IDE is terminating.
static void unregisterDerivedLibrary(java.lang.Class key)
           
 void unregisterDynamicLibraryProvider(DynamicLibraryProvider provider)
          Unregisters a dynamic library provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEGACY_LIBRARY_FILE

public static final java.lang.String LEGACY_LIBRARY_FILE
Deprecated. library.ini format no longer supported.
See Also:
Constant Field Values

LIBRARY_LIST_FILE

public static final java.lang.String LIBRARY_LIST_FILE
See Also:
Constant Field Values

LIBRARY_EXTENSION

public static final java.lang.String LIBRARY_EXTENSION
See Also:
Constant Field Values

JDK_EXTENSION

public static final java.lang.String JDK_EXTENSION
See Also:
Constant Field Values

LIBRARY_ADDED

public static final int LIBRARY_ADDED

LIBRARY_REMOVED

public static final int LIBRARY_REMOVED

SETTINGS_KEY

public static final java.lang.String SETTINGS_KEY
See Also:
Constant Field Values
Constructor Detail

JLibraryManager

public JLibraryManager()
                throws SingletonClassException
Throws:
SingletonClassException
Method Detail

registerDynamicLibraryProvider

public void registerDynamicLibraryProvider(DynamicLibraryProvider provider)
Registers a dynamic library provider with the library manager.

Parameters:
provider - the provider to register. Must not be null.
Throws:
java.lang.NullPointerException - if the provider argument is null.
Since:
11.0

unregisterDynamicLibraryProvider

public void unregisterDynamicLibraryProvider(DynamicLibraryProvider provider)
Unregisters a dynamic library provider.

Parameters:
provider - the provider to unregister.
Since:
11.0

getDynamicLibraryProviders

public java.util.Collection<DynamicLibraryProvider> getDynamicLibraryProviders()
Returns an (immutable) collection of all registered dynamic library providers.

Returns:
an immutable collection of DynamicLibraryProviders.

getInstance

public static JLibraryManager getInstance()
Retrieves the single JLibraryManager instance.

Returns:
the single JLibraryManager instance.

getAllLibraryLists

public static LibraryList[] getAllLibraryLists()
Returns all lists last preserved as the working set. The result will always contain at least the addin library list and the user library list. Note that this does not represent all possible lists, any number of additional JLibraryList instances may be available on the file system.


getLibraries

public static java.util.List getLibraries()
Deprecated. Concept of finite library lists from which to gather libraries no longer exists. Now returns only what can be found within the last working set of library lists.

See Also:
getAllLibraryLists()

getJDKs

public static java.util.List getJDKs()
Deprecated. Concept of finite library lists from which to gather JDKs no longer exists. Now returns only what can be found within the last working set of library lists.

See Also:
getAllLibraryLists()

getDefaultJDK

public static JDK getDefaultJDK()

createLibrary

public static JLibrary createLibrary(java.lang.Object id,
                                     MutableLibraryList list)

findLibrary

public static JLibrary findLibrary(java.lang.Object id)

removeLibrary

public static void removeLibrary(JLibrary lib,
                                 MutableLibraryList list)

createJDK

public static JDK createJDK(java.lang.Object id,
                            java.net.URL javaExe,
                            MutableLibraryList list)

findJDK

public static JDK findJDK(java.lang.Object id)

findJDK

public static JDK findJDK(VersionNumber num,
                          JDK[] jdks)

findJDKMatch

public static JDK findJDKMatch(java.lang.Object id,
                               VersionNumber num)

removeJDK

public static void removeJDK(JDK jdk,
                             MutableLibraryList list)

addLibraryList

public static JLibraryList addLibraryList(java.net.URL url)

removeLibraryList

public static boolean removeLibraryList(LibraryList list)

getUserLibraries

public static JLibraryList getUserLibraries()

getAddinLibraries

public static AddinLibraryList getAddinLibraries()

create

public Dependable create(Element source,
                         Folder sourceOwner)
                  throws java.lang.IllegalAccessException,
                         java.lang.InstantiationException
Description copied from interface: DependableRecognizer
Creates a Dependable that encapsulates the source object. The owner is the folder containing the source.

Specified by:
create in interface DependableRecognizer
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

recognize

public boolean recognize(Element source)
Description copied from interface: DependableRecognizer
Returns true if this dependable factory recognizes the specified source object.

Specified by:
recognize in interface DependableRecognizer

registerDerivedLibrary

public static void registerDerivedLibrary(java.lang.Class key,
                                          java.lang.Class cls)
Call this method to register a DerivedLibrary class. The key should be the source node class. Registered Dependable classes will be recognized by this DependableRecognizer.


unregisterDerivedLibrary

public static void unregisterDerivedLibrary(java.lang.Class key)

shutdown

public void shutdown()
Description copied from interface: ShutdownHook
Called on all shutdown hooks in the order they were registered when the IDE is terminating. The IDE will quit when this method is called, therefore it is unnecessary to perform deregistration tasks that do not have an external effect. For example, it is unnecessary to deregister menu items, but it might be necessary to close a network connection or save a file.

Specified by:
shutdown in interface ShutdownHook

canShutdown

public boolean canShutdown()
This method is called by the IDE to confirm that the ide can shutdown.

Specified by:
canShutdown in interface ShutdownHook
Returns:
true if shutdown can proceed, false to abort shutdown.

initialize

public void initialize()
Description copied from interface: Addin
Invoked by the AddinManager after the instance of the Addin is instantiated. When invoked, The Addin should register and menu items, and actions required for use during this classes lifecycle. Addin authors should take care to ensure that any extraneous initialization is not preformed on this method, and any startup code that can be delayed until a later time is delayed, as the Addin's are synchronously initialized during the startup of the IDE, and each Addin has the potential to negatively impact the startup time of the product.

Specified by:
initialize in interface Addin
See Also:
AddinManager

attach

public void attach(Observer observer)
Description copied from interface: Subject
Registers an observer interested in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is added more than once.

Specified by:
attach in interface Subject
Parameters:
observer - the Observer interested in change notification messages.

detach

public void detach(Observer observer)
Description copied from interface: Subject
Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject interface changes. Implementors should do nothing when the same observer is removed more than once.

Specified by:
detach in interface Subject
Parameters:
observer - the Observer disinterested in change notification messages.

notifyObservers

public void notifyObservers(java.lang.Object subject,
                            UpdateMessage change)
Description copied from interface: Subject
Notifies all observers that the state of the subject has changed.

Specified by:
notifyObservers in interface Subject
Parameters:
subject - the subject whose state has changed.
change - what changed.

addLibraryChangeListener

public void addLibraryChangeListener(ProjectLibraryChangeListener libraryChangeListener)

removeLibraryChangeListener

public void removeLibraryChangeListener(ProjectLibraryChangeListener libraryChangeListener)

projectLibrariesChanged

public void projectLibrariesChanged(Project project,
                                    java.util.Set<java.net.URL> modifiedJars,
                                    java.util.Set<java.net.URL> addedJars,
                                    java.util.Set<java.net.URL> deletedJars)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.