public class LibraryManager extends java.lang.Object implements LibraryProvider
Modifier and Type | Field and Description |
---|---|
private java.util.Collection |
allRefs |
private java.util.List<LibraryDefinition> |
autoRefLibs |
private java.util.List |
libraries |
private java.util.Set |
libRefs |
private static weblogic.application.internal.library.LibraryRegistry |
libReg |
private java.lang.String |
partitionName |
private LibraryReferencer |
referencer |
private java.util.List |
resolvedRefs |
private java.util.Collection |
unresolvedRefs |
Constructor and Description |
---|
LibraryManager(LibraryReferencer referencer,
java.lang.String partitionName)
Initialize with referencer, but without references.
|
LibraryManager(LibraryReferencer referencer,
java.lang.String partitionName,
LibraryReference[] refs)
Initialize with Referencer and library references to lookup.
|
Modifier and Type | Method and Description |
---|---|
void |
addReferences()
Register the LibraryReferencer with the referenced Libraries.
|
private void |
findReferencedLibraries(LibraryReference ref) |
Library[] |
getAutoReferencedLibraries()
Returns the auto referenced libraries.
|
LibraryReference[] |
getLibraryReferences()
Returns the LibraryReferences that resolved successfully.
|
java.io.File[] |
getOptionalPackages(LibraryReference[] refs) |
Library[] |
getReferencedLibraries()
Returns the Libraries for which the references resolved successfully.
|
LibraryRuntimeMBean[] |
getReferencedLibraryRuntimes()
Returns the LibraryRuntimes for which the references resolved successfully.
|
LibraryReferencer |
getReferencer() |
Library[] |
getUnreferencedLibraries()
Returns the Libraries that are not referenced.
|
LibraryReference[] |
getUnresolvedReferences()
Returns the references for which no Libraries were found.
|
java.lang.String |
getUnresolvedReferencesAsString()
Convenience method, returns a String containing all unresolved
references, meant to be used in an error message.
|
java.lang.String |
getUnresolvedReferencesError()
Same as getUnresolvedReferencesError(StringBuffer sb), but just returns a
String instead of appending to provided StringBuffer.
|
void |
getUnresolvedReferencesError(java.lang.StringBuffer sb)
Returns a complete error message for all unresolved references this
LibraryManager knows about.
|
boolean |
hasReferencedLibraries()
Returns true there are any referenced libraries, false otherwise.
|
boolean |
hasUnresolvedReferences()
Determines if any references to Libraries could not be resolved.
|
void |
initializeReferencedLibraries()
Initializes referenced libraries.
|
private boolean |
isDuplicateRef(LibraryReference ref) |
private void |
lookup(LibraryReference inRef)
Lookup Library given a LibraryReference.
|
void |
lookup(LibraryReference[] inRefs)
Lookup Libraries given an Array of LibraryReference Objects.
|
void |
lookupAndAddAutoReferences(Type libType,
LibraryConstants.AutoReferrer referencingType)
Looks up auto-reference libraries and adds references to them.
|
private void |
registerLibrary(LibraryReference ref,
Library lib) |
private void |
registerUnresolvedLibraryRef(LibraryReference ref) |
void |
removeReferences()
Un-register the LibraryReferencer with the referenced Libraries.
|
void |
resetUnresolvedReferences()
Resets the unresolved refs this LibraryManager has.
|
java.lang.String |
toString() |
void |
writeDiagnosticImage(weblogic.application.utils.XMLWriter writer)
Write information about referenced libraries to passed XMLWriter.
|
private static final weblogic.application.internal.library.LibraryRegistry libReg
private final java.util.List libraries
private final java.util.List resolvedRefs
private final java.util.Collection unresolvedRefs
private final java.util.Collection allRefs
private final java.util.Set libRefs
private final LibraryReferencer referencer
private final java.lang.String partitionName
private final java.util.List<LibraryDefinition> autoRefLibs
public LibraryManager(LibraryReferencer referencer, java.lang.String partitionName)
public LibraryManager(LibraryReferencer referencer, java.lang.String partitionName, LibraryReference[] refs)
public void lookup(LibraryReference[] inRefs)
inRefs
- of LibraryRefBeans. For each LibraryRefBean, this method will
attempt to lookup a corresponding Library.private void lookup(LibraryReference inRef)
inRef
- A LibraryReference for which to lookup a LibraryDefinition.private boolean isDuplicateRef(LibraryReference ref)
public Library[] getUnreferencedLibraries()
public boolean hasReferencedLibraries()
public Library[] getReferencedLibraries()
getReferencedLibraries
in interface LibraryProvider
public Library[] getAutoReferencedLibraries()
public LibraryReferencer getReferencer()
public void lookupAndAddAutoReferences(Type libType, LibraryConstants.AutoReferrer referencingType)
libType
- the type of libraries to auto reference. In case null is
passed, all types of libraries are auto-referencedreferencingType
- restrict the auto-references to the ones that state
the referencing type as one of the values in auto-ref manifest headerpublic void initializeReferencedLibraries() throws weblogic.application.library.LoggableLibraryProcessingException
weblogic.application.library.LoggableLibraryProcessingException
public LibraryReference[] getLibraryReferences()
public LibraryRuntimeMBean[] getReferencedLibraryRuntimes()
public boolean hasUnresolvedReferences()
LibraryManager.getUnresolvedReferences()
,
LibraryManager.getUnresolvedReferencesAsString()
public LibraryReference[] getUnresolvedReferences()
public void resetUnresolvedReferences()
public java.lang.String getUnresolvedReferencesAsString()
public void getUnresolvedReferencesError(java.lang.StringBuffer sb)
sb
- The StringBuffer to append the message to.public java.lang.String getUnresolvedReferencesError()
private void registerUnresolvedLibraryRef(LibraryReference ref)
private void registerLibrary(LibraryReference ref, Library lib)
private void findReferencedLibraries(LibraryReference ref)
public void addReferences()
public void removeReferences()
public java.io.File[] getOptionalPackages(LibraryReference[] refs)
public void writeDiagnosticImage(weblogic.application.utils.XMLWriter writer)
public java.lang.String toString()
toString
in class java.lang.Object