public final class PsServices extends java.lang.Object implements PsConstants
Modifier and Type | Class and Description |
---|---|
private static class |
PsServices.DirFilter |
PsConstants.AgentINSTANCE, PsConstants.BoardPKEYS, PsConstants.FwARTIFACTS, PsConstants.FwCLASS, PsConstants.FwDISTRIBUTION, PsConstants.FwPATHS, PsConstants.FwPKEYS, PsConstants.JADEdefaults, PsConstants.KwBASED, PsConstants.NodePKEYS, PsConstants.ToolPARAMETERS
Modifier and Type | Field and Description |
---|---|
private static java.util.ResourceBundle |
DPSNODE_BUNDLE |
private static java.util.HashMap<java.lang.Integer,java.lang.String> |
errorLevels |
private static int |
level0 |
private static int |
level1 |
private static int |
level2 |
private static java.lang.String |
toolName |
Modifier | Constructor and Description |
---|---|
private |
PsServices() |
Modifier and Type | Method and Description |
---|---|
private static void |
addDir(java.io.File dirObj,
java.util.zip.ZipOutputStream out)
Making a zip file of directory including its sub-directories recursively.
|
static void |
addNativeLibraryPath()
This function enables the java.library.path to be modified at runtime.
|
static boolean |
bhvState(java.lang.String value) |
private static java.util.ResourceBundle |
createNodeBundle() |
static java.lang.String[] |
DirList(java.lang.String theDir) |
private static void |
extractFromFirst(java.nio.file.FileSystem fs,
java.lang.String path,
java.lang.String target,
boolean isNdoOpt)
This is an extension of ZipJava ORACLE.
|
static void |
generateNewPsNode(java.lang.String nameOfNewPsNode,
java.lang.String typeOfPsNode)
Make an structure of directories and add it to DPS-Framework nodes directory.
|
static java.lang.String |
getDpsAllEnvironment() |
static java.lang.String |
getDpsJAVAClassesURLs()
View System and Java Virtual Machine variables.
|
static java.lang.String |
getDpsJAVAClassPaths() |
static java.lang.String |
getDpsJVMProperties() |
static java.lang.String |
getDpsNativleLibURLs() |
static java.lang.String |
getDpsOSEnvironment() |
static java.lang.String |
getJVMEnv() |
static java.lang.String |
getNativeLocalPath()
Absolute Path to native libraries required by Knowledge-Agents.
|
static java.lang.String |
getNativePath()
View: http://lopica.sourceforge.net/os.html
for complete list of architectures / OS Names
|
static java.lang.String |
getNativeRelativePath()
Solution adopted has been: the double path for locating natural Java and native libraries C++ for Java.
|
static java.lang.String |
getOSarch()
Host architecture where JVM it is running the JADE Platform.
|
static java.lang.String |
getOSname()
OS name where JVM it is running the JADE Platform.
|
private static java.nio.file.spi.FileSystemProvider |
getZipFSProvider() |
static java.lang.String |
i18n(java.lang.String key)
Read resource keys.
|
static boolean |
isDPSCandidatePath(java.lang.String nameOfNewDir)
Test privileges and existence of this Directory.
|
static boolean |
isDPSFramework()
Test existence of DPS-Framework infrastructure over nameOfDir this dot (.) directory.
|
static boolean |
isDPSFramework(java.lang.String nameOfDir)
Test existence of DPS-Framework infrastructure over that directory.
|
static boolean |
isHeadless()
Version 0.9.2: adapted to headless hosts
|
static boolean |
isPsBoardAgentDir(java.lang.String nameOfBoard)
Test existence of Directories of PsBoardAgent and some file inside FrameworkDir.
|
static boolean |
isPsMonitorAgentDir(java.lang.String nameOfAgent)
Test existence of Directories on simple Agent instance.
|
static boolean |
isPsNodeAgentDir(java.lang.String nameOfNode)
Test existence of Directories and some file of PsNodeAgent inside FrameworkDir.
|
static void |
makeNewPsNode(java.lang.String nameOfNewPsNode,
java.lang.String typeOfPsNode)
Make an structure of directories and add it to DPS-Framework nodes directory.
|
private static void |
mkdirs(java.nio.file.Path path)
It is used by extractFromFirst Function.
|
static void |
printHelp(int level) |
static void |
printHelp(java.lang.String resource) |
private static void |
sysLogger(java.lang.Object[] o)
A simple Logger mechanism.
|
private static void |
sysLogger(java.lang.Object _errorDesc,
java.lang.String _description)
Local version with two parameters of sysLogger method.
|
private static void |
sysLogger(java.lang.Object _errorDesc,
java.lang.String _description,
java.lang.String _cause)
Local version of sysLogger method.
|
static void |
sysLogger(java.lang.String fromClass,
java.lang.String description) |
static void |
sysLogger(java.lang.String fromClass,
java.lang.String errorDesc,
java.lang.String description) |
static void |
sysLogger(java.lang.String fromClass,
java.lang.String errorDesc,
java.lang.String description,
java.lang.String cause) |
static boolean |
testCLASSPATH(java.lang.String clazz,
java.lang.String from)
Test presences about classes in CLASSPATH paths collection.
|
static void |
unzipFolder(java.lang.String agentZipFile,
java.lang.String extractFolder) |
static void |
updateFrameworkProperties(java.lang.String fwPath,
java.lang.String code,
java.lang.String value,
boolean addValue) |
static void |
zipDir(java.lang.String dir,
java.lang.String zipFileName) |
private static final java.util.ResourceBundle DPSNODE_BUNDLE
private static final int level0
private static final int level1
private static final int level2
private static final java.lang.String toolName
private static final java.util.HashMap<java.lang.Integer,java.lang.String> errorLevels
private static java.util.ResourceBundle createNodeBundle()
public static java.lang.String i18n(java.lang.String key)
key
- Key on dpsnode_messages.properties resource file.public static java.lang.String getOSarch()
public static java.lang.String getOSname()
public static java.lang.String getNativePath()
public static java.lang.String getNativeLocalPath()
public static java.lang.String getNativeRelativePath()
The first is a hard-code to ./lib/name-of-architecture. It permits to make a Developer's Environment and it take its data from getNativeLibPath().
The second solutions is made from NativeRelativePath() plus addNativeLibraryPath() amplification. This solution is for deployment at big scale inside servers. It requires make the new variable (sFrameworkAppNativeLib) in framework.properties ("ps.framework.app.nativelib") and uses it for make a new Paths to Operating System. Relative or absolute. Its mission is for Systems Administrators and for setup a centralization model of libraries of JADE, Jess, BeanShell and CLIPS, plus the gateway of JNI CLIPSJNI.xxx library for each architecture.
public static boolean isDPSCandidatePath(java.lang.String nameOfNewDir)
nameOfNewDir
- Name for the new Framework.public static boolean isDPSFramework(java.lang.String nameOfDir)
nameOfDir
- Name of Framework to analyze.public static boolean isDPSFramework()
public static boolean isPsMonitorAgentDir(java.lang.String nameOfAgent)
nameOfAgent
- Name of Agent's instance to analyze.public static boolean isPsNodeAgentDir(java.lang.String nameOfNode)
nameOfNode
- Name of Node to analyze.public static boolean isPsBoardAgentDir(java.lang.String nameOfBoard)
nameOfBoard
- Name of TicketBoard Agent to analyze.private static void extractFromFirst(java.nio.file.FileSystem fs, java.lang.String path, java.lang.String target, boolean isNdoOpt) throws java.lang.Throwable
fs
- The file system from extract.path
- The path from getting files.target
- The final point where data is saved like file.isNdoOpt
- making new PsNode.java.lang.Throwable
- Error caption.private static void mkdirs(java.nio.file.Path path) throws java.io.IOException
path
- Position where files will be copied.java.io.IOException
- When to make a new directory was not possible.public static void addNativeLibraryPath() throws java.io.IOException
Sun Engineers + Filter of Local (dps.library.path). http://forums.sun.com/thread.jspa?threadID=707176
java.io.IOException
- Method for capturing an error situation.public static java.lang.String getDpsJAVAClassesURLs()
public static java.lang.String getDpsNativleLibURLs()
public static java.lang.String getDpsJAVAClassPaths()
public static java.lang.String getDpsOSEnvironment()
public static java.lang.String getDpsJVMProperties()
public static java.lang.String getDpsAllEnvironment()
public static java.lang.String getJVMEnv()
public static java.lang.String[] DirList(java.lang.String theDir)
private static void addDir(java.io.File dirObj, java.util.zip.ZipOutputStream out) throws java.io.IOException
dirObj
- The directory to compress.out
- The ZipOutputStream where zip files will be created.java.io.IOException
- When something about compress made crash..public static void zipDir(java.lang.String dir, java.lang.String zipFileName) throws java.lang.Exception
java.lang.Exception
public static void updateFrameworkProperties(java.lang.String fwPath, java.lang.String code, java.lang.String value, boolean addValue)
fwPath
- Path to location.code
- Name of property.value
- Value to incorporate.addValue
- If added that value.private static java.nio.file.spi.FileSystemProvider getZipFSProvider()
public static void generateNewPsNode(java.lang.String nameOfNewPsNode, java.lang.String typeOfPsNode) throws java.lang.Throwable
NOTE: from October versions, this functions only inside Development-Agent Environment, that is, not when applications are running on big scale mode with centralized libraries.
nameOfNewPsNode
- Name of new node.typeOfPsNode
- Select kind of nodejava.lang.Throwable
- Method for capturing errors situations.public static void makeNewPsNode(java.lang.String nameOfNewPsNode, java.lang.String typeOfPsNode) throws java.lang.Throwable
NOTE: from October versions, this functions only inside Development-Agent Environment, that is, not when applications are running on big scale mode with centralized libraries.
nameOfNewPsNode
- Name of new node.typeOfPsNode
- Select kind of nodejava.lang.Throwable
- Method for capturing errors situations.public static boolean bhvState(java.lang.String value)
public static boolean isHeadless()
public static void unzipFolder(java.lang.String agentZipFile, java.lang.String extractFolder)
public static void printHelp(java.lang.String resource)
public static void printHelp(int level)
private static void sysLogger(java.lang.Object[] o)
o
- An object to print out.public static void sysLogger(java.lang.String fromClass, java.lang.String errorDesc, java.lang.String description)
public static void sysLogger(java.lang.String fromClass, java.lang.String errorDesc, java.lang.String description, java.lang.String cause)
public static void sysLogger(java.lang.String fromClass, java.lang.String description)
public static boolean testCLASSPATH(java.lang.String clazz, java.lang.String from)
clazz
- Name of class to test.private static void sysLogger(java.lang.Object _errorDesc, java.lang.String _description, java.lang.String _cause)
_errorDesc
- Level error description or String level error description._description
- A description about the detected error._cause
- Error cause of.private static void sysLogger(java.lang.Object _errorDesc, java.lang.String _description)
_errorDesc
- Level error description._description
- Error description.