Class SynapseLibrary
- java.lang.Object
-
- org.apache.synapse.libraries.model.SynapseLibrary
-
- All Implemented Interfaces:
Library
,SynapseArtifact
public class SynapseLibrary extends Object implements Library
-
-
Field Summary
Fields Modifier and Type Field Description List<LibraryArtifact.Dependency>
dependencies
protected QName
qualifiedName
this is the logical name of the Synapse library which constitutes of [package + library name]
-
Constructor Summary
Constructors Constructor Description SynapseLibrary(String name, String packageName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addArtifactDescription(LibraryArtifact artifact)
void
addComponent(String qualifiedName, Object libComponent)
void
addDependency(LibraryArtifact.Dependency artifactDep)
void
clear()
Object
getArtifact(String artifacName)
return synapse lib artifact deployed by this library with the given Local nameString
getArtifactDescription(String artifactName)
gives the Artifact description for the given artifact name (if available)Map<String,Object>
getArtifacts()
String
getDescription()
Retrieves the description of the artifactString
getFileName()
Map<String,String>
getLibArtifactDetails()
ClassLoader
getLibClassLoader()
boolean
getLibStatus()
Gets the library status which can determine whether the library should be available during run timeList<String>
getLocalEntries()
Map<String,Object>
getLocalEntryArtifacts()
Returns the list of local entry definitionsString
getName()
String
getPackage()
returns the package that this Library belongs toQName
getQName()
get Fully qualified Name of the Libraryboolean
loadLibrary()
load all library artifacts on this library this should be called when a import is taking placevoid
loadLibrary(String artifactDependencyName)
load all library artifacts on this library for the given QName this should be called when a import is taking placevoid
removeComponent(String qualifiedName)
boolean
resolveDependencies(List<LibraryArtifact> unresolvedPrincipalArtifactList)
void
setDescription(String description)
Set the description of the artifactvoid
setFileName(String fileName)
void
setLibClassLoader(ClassLoader libClassLoader)
void
setLibStatus(boolean status)
String
toString()
boolean
unLoadLibrary()
unload all library artifacts on this library for the given QName this should be called when a import is no longer valid/ non-existent
-
-
-
Field Detail
-
qualifiedName
protected QName qualifiedName
this is the logical name of the Synapse library which constitutes of [package + library name]
-
dependencies
public List<LibraryArtifact.Dependency> dependencies
-
-
Method Detail
-
getQName
public QName getQName()
Description copied from interface:Library
get Fully qualified Name of the Library
-
getName
public String getName()
-
addDependency
public void addDependency(LibraryArtifact.Dependency artifactDep)
-
addArtifactDescription
public void addArtifactDescription(LibraryArtifact artifact)
-
getArtifactDescription
public String getArtifactDescription(String artifactName)
Description copied from interface:Library
gives the Artifact description for the given artifact name (if available)- Specified by:
getArtifactDescription
in interfaceLibrary
- Returns:
-
getLibArtifactDetails
public Map<String,String> getLibArtifactDetails()
- Specified by:
getLibArtifactDetails
in interfaceLibrary
-
removeComponent
public void removeComponent(String qualifiedName)
-
resolveDependencies
public boolean resolveDependencies(List<LibraryArtifact> unresolvedPrincipalArtifactList)
-
loadLibrary
public boolean loadLibrary()
load all library artifacts on this library this should be called when a import is taking place- Specified by:
loadLibrary
in interfaceLibrary
- Returns:
- success
-
loadLibrary
public void loadLibrary(String artifactDependencyName)
load all library artifacts on this library for the given QName this should be called when a import is taking place
-
unLoadLibrary
public boolean unLoadLibrary()
unload all library artifacts on this library for the given QName this should be called when a import is no longer valid/ non-existent- Specified by:
unLoadLibrary
in interfaceLibrary
- Returns:
- success
-
getLibClassLoader
public ClassLoader getLibClassLoader()
- Specified by:
getLibClassLoader
in interfaceLibrary
- Returns:
- the Class loader that can be used to load classes/resources under this library
-
getFileName
public String getFileName()
- Specified by:
getFileName
in interfaceLibrary
-
setFileName
public void setFileName(String fileName)
- Specified by:
setFileName
in interfaceLibrary
-
clear
public void clear()
-
getArtifact
public Object getArtifact(String artifacName)
return synapse lib artifact deployed by this library with the given Local name- Specified by:
getArtifact
in interfaceLibrary
- Parameters:
artifacName
-- Returns:
-
getArtifacts
public Map<String,Object> getArtifacts()
- Specified by:
getArtifacts
in interfaceLibrary
-
getPackage
public String getPackage()
Description copied from interface:Library
returns the package that this Library belongs to- Specified by:
getPackage
in interfaceLibrary
- Returns:
- package name
-
setDescription
public void setDescription(String description)
Description copied from interface:SynapseArtifact
Set the description of the artifact- Specified by:
setDescription
in interfaceSynapseArtifact
- Parameters:
description
- tobe set to the artifact
-
getDescription
public String getDescription()
Description copied from interface:SynapseArtifact
Retrieves the description of the artifact- Specified by:
getDescription
in interfaceSynapseArtifact
- Returns:
- description of the artifact
-
setLibClassLoader
public void setLibClassLoader(ClassLoader libClassLoader)
-
getLocalEntryArtifacts
public Map<String,Object> getLocalEntryArtifacts()
Description copied from interface:Library
Returns the list of local entry definitions- Specified by:
getLocalEntryArtifacts
in interfaceLibrary
- Returns:
-
getLocalEntries
public List<String> getLocalEntries()
- Specified by:
getLocalEntries
in interfaceLibrary
-
getLibStatus
public boolean getLibStatus()
Description copied from interface:Library
Gets the library status which can determine whether the library should be available during run time- Specified by:
getLibStatus
in interfaceLibrary
- Returns:
-
setLibStatus
public void setLibStatus(boolean status)
- Specified by:
setLibStatus
in interfaceLibrary
-
-