Class ManifoldCF
- java.lang.Object
-
- org.apache.manifoldcf.core.system.ManifoldCF
-
- Direct Known Subclasses:
ManifoldCF,ManifoldCF
public class ManifoldCF extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classManifoldCF.CachePollClass that cleans up expired cache objects on polling.protected static classManifoldCF.DatabaseConnectionReleaseThreadThe thread that actually releases database connectionsprotected static classManifoldCF.DatabaseShutdownClass that cleans up database handles on exitprotected static classManifoldCF.FileTrackClass that tracks files that need to be cleaned up on exitprotected static classManifoldCF.OverrideableManifoldCFConfigurationFor local properties (not shared!!), this class allows them to be overridden directly from the command line.protected static classManifoldCF.ShutdownThreadFinisher thread, to be registered with the runtime
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected static booleanalreadyClosedprotected static booleanalreadyShutdownprotected static java.lang.StringapplicationNamestatic java.lang.StringATTRIBUTE_PATHstatic java.lang.StringauthImplementationAuth implementation classprotected static java.util.List<IShutdownHook>cleanupHooksArray of cleanup hooks (for managing shutdown)static java.lang.StringconfigSignalCommandPropertyScript to invoke when configuration changes, if anystatic java.lang.StringdatabaseConnectionTrackingPropertyConnection tracking debug propertystatic java.lang.StringdatabaseHandleMaxcountPropertyMaximum open database handles propertystatic java.lang.StringdatabaseHandleTimeoutPropertyDatabase handle timeout propertystatic java.lang.StringdatabaseImplementationDatabase implementation classstatic java.lang.StringdatabaseQueryMaxTimePropertyElapsed time a query can take before a warning is output to the log, in secondsprotected static ManifoldCF.DatabaseShutdowndbShutdownDatabase handle cleanupstatic java.lang.StringfileResourcesPropertyLocation of file resourcesprotected static java.lang.IntegerinitializeFlagLockprotected static intinitializeLevelprotected static intIV_LENGTHstatic java.lang.StringlcfConfigFilePropertyprotected static ManifoldCFConfigurationlocalConfigurationstatic java.lang.StringlockManagerImplementationLock manager implementation classstatic java.lang.StringlogConfigFilePropertyLocation of log configuration filestatic java.lang.StringmaintenanceFileSignalPropertyFile to look for to block access to UI during database maintenanceprotected static java.lang.StringmasterDatabaseNamestatic java.lang.StringmasterDatabaseNamePropertyDatabase name propertyprotected static java.lang.StringmasterDatabasePasswordstatic java.lang.StringmasterDatabasePasswordPropertyDatabase password propertyprotected static java.lang.StringmasterDatabaseUsernamestatic java.lang.StringmasterDatabaseUsernamePropertyDatabase user name propertyprotected static java.lang.StringmcfVersionstatic java.lang.StringNODE_LIBDIRprotected static java.util.List<IPollingHook>pollingHooksArray of polling hooks (for managing polling)protected static java.lang.StringprocessIDProcess ID (no more than 16 characters)static java.lang.StringprocessIDPropertyProcess ID - cannot exceed 16 charactersprotected static longpropertyFilelastModprotected static java.lang.StringpropertyFilePathprotected static ManifoldCFResourceLoaderresourceLoaderThe object that manages ManifoldCF plugin class loading.static java.lang.StringsaltPropertyEncryption salt propertyprotected static java.lang.ThreadshutdownThreadShutdown threadprotected static ManifoldCF.FileTracktrackerTemporary file collectorstatic java.lang.StringversionPropertyThe current ManifoldCF version stringprotected static java.io.FileworkingDirectoryThis is the working directory file object.
-
Constructor Summary
Constructors Constructor Description ManifoldCF()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddFile(java.io.File f)Add a file to the tracking system.static voidaddPollingHook(IPollingHook hook)Add a polling hook to the list.static voidaddShutdownHook(IShutdownHook hook)Add a cleanup hook to the list.static voidaddToHash(java.security.MessageDigest digest, java.lang.String input)Add to hashstatic booleancheckMaintenanceUnderway()Check if maintenance is underway.static voidcheckProperties()Reloads properties as needed.static voidcleanUpEnvironment()Deprecated.static voidcleanUpEnvironment(IThreadContext threadContext)Perform system shutdown, using the registered shutdown hooks.static ManifoldCFResourceLoadercreateResourceLoader()Create a new resource loader based on the default one.static voidcreateSystemDatabase(IThreadContext threadcontext, java.lang.String masterUsername, java.lang.String masterPassword)Install system database.static java.io.FilecreateTempDir(java.lang.String prefix, java.lang.String suffix)Create temporary directory.static java.lang.Stringdecrypt(java.lang.String saltValue, java.lang.String passCode, java.lang.String input)Decrypt a string.static voiddeleteFile(java.io.File f)Use the tracking system to delete a file.static voiddeleteFolder(java.lang.String path)Delete a folder path.static java.lang.Stringdeobfuscate(java.lang.String input)Decode a string encoded using the obfuscation technique.static voiddropSystemDatabase(IThreadContext threadcontext, java.lang.String masterUsername, java.lang.String masterPassword)Drop system database.static java.lang.Stringencrypt(java.lang.String saltValue, java.lang.String passCode, java.lang.String input)Encrypt a string in a reversible encryption.static voidensureFolder(java.lang.String path)Attempt to make sure a path is a folderstatic java.lang.ClassfindClass(java.lang.String cname)Locate a class in the configuration-determined class path.static booleangetBooleanProperty(java.lang.String s, boolean defaultValue)Read a boolean propertystatic java.lang.StringgetChildDatabaseName(IDBInterface companyDatabase, java.lang.String childDBIdentifier)Find a child database name given a company database instance and the child database identifier.protected static javax.crypto.CiphergetCipher(java.lang.String saltValue, int mode, java.lang.String passCode, byte[] iv)protected static javax.crypto.CiphergetCipher(IThreadContext threadContext, int mode, java.lang.String passCode, byte[] iv)static ManifoldCFConfigurationgetConfiguration()Get current properties.static doublegetDoubleProperty(java.lang.String s, double defaultValue)Read a float property, either from the system properties, or from the local configuration file.static java.io.FilegetFileProperty(java.lang.String s)Read a File property, either from the system properties, or from the local configuration file.static java.lang.StringgetHashValue(java.security.MessageDigest digest)Calculate final hash valuestatic intgetIntProperty(java.lang.String s, int defaultValue)Read an integer property, either from the system properties, or from the local configuration file.static longgetLongProperty(java.lang.String s, long defaultValue)Read a long property, either from the system properties, or from the local configuration file.static java.lang.StringgetMasterDatabaseName()Get the master database name.static java.lang.StringgetMasterDatabasePassword()Get the master database password.static java.lang.StringgetMasterDatabaseUsername()Get the master database username.static java.lang.StringgetMcfVersion()Get the mcf version.static java.lang.StringgetProcessID()Get process IDstatic java.lang.StringgetProperty(java.lang.String s)Read a (string) property, either from the system properties, or from the local configuration file.protected static java.lang.StringgetSaltValue(IThreadContext threadContext)protected static byte[]getSecureRandom()static java.lang.StringgetStringProperty(java.lang.String s, java.lang.String defaultValue)Read a (string) property, either from the system properties, or from the local configuration file.static java.lang.Stringhash(java.lang.String input)Perform standard hashing of a stringstatic voidinitializeEnvironment()Deprecated.static voidinitializeEnvironment(IThreadContext threadContext)Initialize environment.static booleanisFolder(java.lang.String path)Discover if a path is a folderstatic voidnoteConfigurationChange()Note configuration change.static java.lang.Stringobfuscate(java.lang.String input)Encode a string in a reversible obfuscation.static voidpollAll(IThreadContext threadContext)Poll all the registered polling services.static intreadByte(java.io.InputStream is)Read a byte from an input streamstatic byte[]readByteArray(java.io.InputStream is)Read a byte array from an input streamstatic voidreadBytes(java.io.InputStream is, byte[] byteArray)Read bytes from the input stream into specified array.static intreadDword(java.io.InputStream is)Read a dword from an input streamstatic floatreadfloat(java.io.InputStream os)Read a float value from an input streamstatic java.lang.LongreadLong(java.io.InputStream is)Read a Long from an input streamprotected static intreadNibble(char value)Read a hex nibble.static intreadSdword(java.io.InputStream is)Read a signed dword from an input streamstatic java.lang.StringreadString(java.io.InputStream is)Read a String from an input streamstatic intreadWord(java.io.InputStream is)Read a word from an input streamstatic voidrecursiveDelete(java.io.File directoryPath)Recursive delete: for cleaning up company folder.protected static voidregisterConnectorServices()Register connector services provided in connectors and connector-commonsstatic voidresetEnvironment()Deprecated.static voidresetEnvironment(IThreadContext threadContext)Reset environment.static java.io.FileresolvePath(java.lang.String path)Resolve a file path, possibly relative to ManifoldCF's concept of its "working directory".static java.lang.StringsafeFileName(java.lang.String value)Convert a string into a safe, unique filename.static voidsleep(long milliseconds)Use this method to sleep instead of Thread.sleep().static java.security.MessageDigeststartHash()Start creating a hashstatic voidsystemExit(int rval)Shutdown the system using a background thread.static voidwriteByte(java.io.OutputStream os, int byteValue)Write a byte to an output streamstatic voidwriteByteArray(java.io.OutputStream os, byte[] byteArray)Write a byte array to an output streamstatic voidwriteBytes(java.io.OutputStream os, byte[] byteArray)Write a bunch of bytes to the output streamstatic voidwriteDword(java.io.OutputStream os, int dwordValue)Write a dword to an output streamstatic voidwritefloat(java.io.OutputStream os, float floatValue)Write a float value to an output streamstatic voidwriteLong(java.io.OutputStream os, java.lang.Long longValue)Write a Long to an output streamprotected static charwriteNibble(int value)Write a hex nibble.static voidwriteSdword(java.io.OutputStream os, int dwordValue)Write a signed dword to an output streamstatic voidwriteString(java.io.OutputStream os, java.lang.String stringValue)Write a String to an output streamstatic voidwriteWord(java.io.OutputStream os, int wordValue)Write a word to an output stream
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
NODE_LIBDIR
public static final java.lang.String NODE_LIBDIR
- See Also:
- Constant Field Values
-
ATTRIBUTE_PATH
public static final java.lang.String ATTRIBUTE_PATH
- See Also:
- Constant Field Values
-
processID
protected static java.lang.String processID
Process ID (no more than 16 characters)
-
workingDirectory
protected static java.io.File workingDirectory
This is the working directory file object.
-
resourceLoader
protected static ManifoldCFResourceLoader resourceLoader
The object that manages ManifoldCF plugin class loading. This is initialized when the initialize method is called.
-
tracker
protected static ManifoldCF.FileTrack tracker
Temporary file collector
-
dbShutdown
protected static ManifoldCF.DatabaseShutdown dbShutdown
Database handle cleanup
-
cleanupHooks
protected static final java.util.List<IShutdownHook> cleanupHooks
Array of cleanup hooks (for managing shutdown)
-
pollingHooks
protected static final java.util.List<IPollingHook> pollingHooks
Array of polling hooks (for managing polling)
-
shutdownThread
protected static java.lang.Thread shutdownThread
Shutdown thread
-
initializeLevel
protected static int initializeLevel
-
alreadyClosed
protected static boolean alreadyClosed
-
alreadyShutdown
protected static boolean alreadyShutdown
-
initializeFlagLock
protected static java.lang.Integer initializeFlagLock
-
mcfVersion
protected static java.lang.String mcfVersion
-
masterDatabaseName
protected static java.lang.String masterDatabaseName
-
masterDatabaseUsername
protected static java.lang.String masterDatabaseUsername
-
masterDatabasePassword
protected static java.lang.String masterDatabasePassword
-
localConfiguration
protected static ManifoldCFConfiguration localConfiguration
-
propertyFilelastMod
protected static long propertyFilelastMod
-
propertyFilePath
protected static java.lang.String propertyFilePath
-
applicationName
protected static final java.lang.String applicationName
- See Also:
- Constant Field Values
-
lcfConfigFileProperty
public static final java.lang.String lcfConfigFileProperty
- See Also:
- Constant Field Values
-
versionProperty
public static final java.lang.String versionProperty
The current ManifoldCF version string- See Also:
- Constant Field Values
-
processIDProperty
public static final java.lang.String processIDProperty
Process ID - cannot exceed 16 characters- See Also:
- Constant Field Values
-
masterDatabaseNameProperty
public static final java.lang.String masterDatabaseNameProperty
Database name property- See Also:
- Constant Field Values
-
masterDatabaseUsernameProperty
public static final java.lang.String masterDatabaseUsernameProperty
Database user name property- See Also:
- Constant Field Values
-
masterDatabasePasswordProperty
public static final java.lang.String masterDatabasePasswordProperty
Database password property- See Also:
- Constant Field Values
-
databaseHandleMaxcountProperty
public static final java.lang.String databaseHandleMaxcountProperty
Maximum open database handles property- See Also:
- Constant Field Values
-
databaseHandleTimeoutProperty
public static final java.lang.String databaseHandleTimeoutProperty
Database handle timeout property- See Also:
- Constant Field Values
-
databaseConnectionTrackingProperty
public static final java.lang.String databaseConnectionTrackingProperty
Connection tracking debug property- See Also:
- Constant Field Values
-
databaseQueryMaxTimeProperty
public static final java.lang.String databaseQueryMaxTimeProperty
Elapsed time a query can take before a warning is output to the log, in seconds- See Also:
- Constant Field Values
-
logConfigFileProperty
public static final java.lang.String logConfigFileProperty
Location of log configuration file- See Also:
- Constant Field Values
-
fileResourcesProperty
public static final java.lang.String fileResourcesProperty
Location of file resources- See Also:
- Constant Field Values
-
lockManagerImplementation
public static final java.lang.String lockManagerImplementation
Lock manager implementation class- See Also:
- Constant Field Values
-
databaseImplementation
public static final java.lang.String databaseImplementation
Database implementation class- See Also:
- Constant Field Values
-
authImplementation
public static final java.lang.String authImplementation
Auth implementation class- See Also:
- Constant Field Values
-
configSignalCommandProperty
public static final java.lang.String configSignalCommandProperty
Script to invoke when configuration changes, if any- See Also:
- Constant Field Values
-
maintenanceFileSignalProperty
public static final java.lang.String maintenanceFileSignalProperty
File to look for to block access to UI during database maintenance- See Also:
- Constant Field Values
-
saltProperty
public static final java.lang.String saltProperty
Encryption salt property- See Also:
- Constant Field Values
-
IV_LENGTH
protected static final int IV_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
resetEnvironment
@Deprecated public static void resetEnvironment()
Deprecated.Reset environment, minting a thread context for convenience and backwards compatibility.
-
resetEnvironment
public static void resetEnvironment(IThreadContext threadContext)
Reset environment.
-
initializeEnvironment
@Deprecated public static void initializeEnvironment() throws ManifoldCFExceptionDeprecated.Initialize environment, minting a thread context for backwards compatibility.- Throws:
ManifoldCFException
-
initializeEnvironment
public static void initializeEnvironment(IThreadContext threadContext) throws ManifoldCFException
Initialize environment.- Throws:
ManifoldCFException
-
registerConnectorServices
protected static void registerConnectorServices() throws ManifoldCFExceptionRegister connector services provided in connectors and connector-commons- Throws:
ManifoldCFException
-
getProcessID
public static final java.lang.String getProcessID()
Get process ID
-
getConfiguration
public static final ManifoldCFConfiguration getConfiguration()
Get current properties. Makes no attempt to reread or interpret them.
-
checkProperties
public static final void checkProperties() throws ManifoldCFExceptionReloads properties as needed.- Throws:
ManifoldCFException
-
resolvePath
public static java.io.File resolvePath(java.lang.String path)
Resolve a file path, possibly relative to ManifoldCF's concept of its "working directory".- Parameters:
path- is the path, to be calculated relative to the ManifoldCF "working directory".- Returns:
- the resolved file.
-
getProperty
public static java.lang.String getProperty(java.lang.String s)
Read a (string) property, either from the system properties, or from the local configuration file.- Parameters:
s- is the property name.- Returns:
- the property value, as a string.
-
getFileProperty
public static java.io.File getFileProperty(java.lang.String s)
Read a File property, either from the system properties, or from the local configuration file. Relative file references are resolved according to the "working directory" for ManifoldCF.
-
getStringProperty
public static java.lang.String getStringProperty(java.lang.String s, java.lang.String defaultValue)Read a (string) property, either from the system properties, or from the local configuration file.- Parameters:
s- is the property name.defaultValue- is the default value for the property.- Returns:
- the property value, as a string.
-
getBooleanProperty
public static boolean getBooleanProperty(java.lang.String s, boolean defaultValue) throws ManifoldCFExceptionRead a boolean property- Throws:
ManifoldCFException
-
getIntProperty
public static int getIntProperty(java.lang.String s, int defaultValue) throws ManifoldCFExceptionRead an integer property, either from the system properties, or from the local configuration file.- Throws:
ManifoldCFException
-
getLongProperty
public static long getLongProperty(java.lang.String s, long defaultValue) throws ManifoldCFExceptionRead a long property, either from the system properties, or from the local configuration file.- Throws:
ManifoldCFException
-
getDoubleProperty
public static double getDoubleProperty(java.lang.String s, double defaultValue) throws ManifoldCFExceptionRead a float property, either from the system properties, or from the local configuration file.- Throws:
ManifoldCFException
-
ensureFolder
public static void ensureFolder(java.lang.String path) throws ManifoldCFExceptionAttempt to make sure a path is a folder- Parameters:
path-- Throws:
ManifoldCFException
-
deleteFolder
public static void deleteFolder(java.lang.String path)
Delete a folder path.- Parameters:
path- is the folder path.
-
recursiveDelete
public static void recursiveDelete(java.io.File directoryPath)
Recursive delete: for cleaning up company folder.- Parameters:
directoryPath- is the File describing the directory or file to be removed.
-
isFolder
public static boolean isFolder(java.lang.String path)
Discover if a path is a folder- Parameters:
path- spec, 'unix' form mostly
-
safeFileName
public static java.lang.String safeFileName(java.lang.String value)
Convert a string into a safe, unique filename.- Parameters:
value- is the string.- Returns:
- the file name.
-
systemExit
public static void systemExit(int rval)
Shutdown the system using a background thread.
-
getMcfVersion
public static java.lang.String getMcfVersion()
Get the mcf version.- Returns:
- the version string
-
getMasterDatabaseName
public static java.lang.String getMasterDatabaseName()
Get the master database name.- Returns:
- the master database name
-
getMasterDatabaseUsername
public static java.lang.String getMasterDatabaseUsername()
Get the master database username.- Returns:
- the master database username.
-
getMasterDatabasePassword
public static java.lang.String getMasterDatabasePassword()
Get the master database password.- Returns:
- the master database password.
-
getChildDatabaseName
public static java.lang.String getChildDatabaseName(IDBInterface companyDatabase, java.lang.String childDBIdentifier)
Find a child database name given a company database instance and the child database identifier.- Parameters:
companyDatabase- is the company database.childDBIdentifier- is the identifier.- Returns:
- the child database name.
-
hash
public static java.lang.String hash(java.lang.String input) throws ManifoldCFExceptionPerform standard hashing of a string- Parameters:
input- is the string to hash.- Returns:
- the encrypted string.
- Throws:
ManifoldCFException
-
startHash
public static java.security.MessageDigest startHash() throws ManifoldCFExceptionStart creating a hash- Throws:
ManifoldCFException
-
addToHash
public static void addToHash(java.security.MessageDigest digest, java.lang.String input) throws ManifoldCFExceptionAdd to hash- Throws:
ManifoldCFException
-
getHashValue
public static java.lang.String getHashValue(java.security.MessageDigest digest) throws ManifoldCFExceptionCalculate final hash value- Throws:
ManifoldCFException
-
getSaltValue
protected static java.lang.String getSaltValue(IThreadContext threadContext) throws ManifoldCFException
- Throws:
ManifoldCFException
-
getCipher
protected static javax.crypto.Cipher getCipher(IThreadContext threadContext, int mode, java.lang.String passCode, byte[] iv) throws ManifoldCFException
- Throws:
ManifoldCFException
-
getCipher
protected static javax.crypto.Cipher getCipher(java.lang.String saltValue, int mode, java.lang.String passCode, byte[] iv) throws ManifoldCFException- Throws:
ManifoldCFException
-
getSecureRandom
protected static byte[] getSecureRandom()
-
obfuscate
public static java.lang.String obfuscate(java.lang.String input) throws ManifoldCFExceptionEncode a string in a reversible obfuscation.- Parameters:
input- is the input string.- Returns:
- the output string.
- Throws:
ManifoldCFException
-
deobfuscate
public static java.lang.String deobfuscate(java.lang.String input) throws ManifoldCFExceptionDecode a string encoded using the obfuscation technique.- Parameters:
input- is the input string.- Returns:
- the decoded string.
- Throws:
ManifoldCFException
-
encrypt
public static java.lang.String encrypt(java.lang.String saltValue, java.lang.String passCode, java.lang.String input) throws ManifoldCFExceptionEncrypt a string in a reversible encryption.- Parameters:
saltValue- is the salt value.passCode- is the pass code.input- is the input string.- Returns:
- the output string.
- Throws:
ManifoldCFException
-
decrypt
public static java.lang.String decrypt(java.lang.String saltValue, java.lang.String passCode, java.lang.String input) throws ManifoldCFExceptionDecrypt a string.- Parameters:
saltValue- is the salt value.passCode- is the pass code.input- is the input string.- Returns:
- the decoded string.
- Throws:
ManifoldCFException
-
writeNibble
protected static char writeNibble(int value)
Write a hex nibble.- Parameters:
value- is the value to write.- Returns:
- the character.
-
readNibble
protected static int readNibble(char value) throws ManifoldCFExceptionRead a hex nibble.- Parameters:
value- is the character.- Returns:
- the value.
- Throws:
ManifoldCFException
-
createSystemDatabase
public static void createSystemDatabase(IThreadContext threadcontext, java.lang.String masterUsername, java.lang.String masterPassword) throws ManifoldCFException
Install system database.- Parameters:
threadcontext- is the thread context.masterUsername- is the master database user name.masterPassword- is the master database password.- Throws:
ManifoldCFException
-
dropSystemDatabase
public static void dropSystemDatabase(IThreadContext threadcontext, java.lang.String masterUsername, java.lang.String masterPassword) throws ManifoldCFException
Drop system database.- Parameters:
threadcontext- is the thread context.masterUsername- is the master database user name.masterPassword- is the master database password.- Throws:
ManifoldCFException
-
createTempDir
public static java.io.File createTempDir(java.lang.String prefix, java.lang.String suffix) throws ManifoldCFExceptionCreate temporary directory.- Throws:
ManifoldCFException
-
addFile
public static void addFile(java.io.File f)
Add a file to the tracking system.
-
deleteFile
public static void deleteFile(java.io.File f)
Use the tracking system to delete a file. You MUST use this to delete any file that was added to the tracking system with addFile().
-
checkMaintenanceUnderway
public static boolean checkMaintenanceUnderway()
Check if maintenance is underway.
-
noteConfigurationChange
public static void noteConfigurationChange() throws ManifoldCFExceptionNote configuration change.- Throws:
ManifoldCFException
-
sleep
public static void sleep(long milliseconds) throws java.lang.InterruptedExceptionUse this method to sleep instead of Thread.sleep(). Thread.sleep() doesn't seem to work well when the system time is reset.- Throws:
java.lang.InterruptedException
-
writeBytes
public static void writeBytes(java.io.OutputStream os, byte[] byteArray) throws java.io.IOExceptionWrite a bunch of bytes to the output stream- Throws:
java.io.IOException
-
writeByte
public static void writeByte(java.io.OutputStream os, int byteValue) throws java.io.IOExceptionWrite a byte to an output stream- Throws:
java.io.IOException
-
writeWord
public static void writeWord(java.io.OutputStream os, int wordValue) throws java.io.IOExceptionWrite a word to an output stream- Throws:
java.io.IOException
-
writeDword
public static void writeDword(java.io.OutputStream os, int dwordValue) throws java.io.IOExceptionWrite a dword to an output stream- Throws:
java.io.IOException
-
writeSdword
public static void writeSdword(java.io.OutputStream os, int dwordValue) throws java.io.IOExceptionWrite a signed dword to an output stream- Throws:
java.io.IOException
-
writeLong
public static void writeLong(java.io.OutputStream os, java.lang.Long longValue) throws java.io.IOExceptionWrite a Long to an output stream- Throws:
java.io.IOException
-
writeString
public static void writeString(java.io.OutputStream os, java.lang.String stringValue) throws java.io.IOExceptionWrite a String to an output stream- Throws:
java.io.IOException
-
writeByteArray
public static void writeByteArray(java.io.OutputStream os, byte[] byteArray) throws java.io.IOExceptionWrite a byte array to an output stream- Throws:
java.io.IOException
-
writefloat
public static void writefloat(java.io.OutputStream os, float floatValue) throws java.io.IOExceptionWrite a float value to an output stream- Throws:
java.io.IOException
-
readBytes
public static void readBytes(java.io.InputStream is, byte[] byteArray) throws java.io.IOExceptionRead bytes from the input stream into specified array.- Throws:
java.io.IOException
-
readByte
public static int readByte(java.io.InputStream is) throws java.io.IOExceptionRead a byte from an input stream- Throws:
java.io.IOException
-
readWord
public static int readWord(java.io.InputStream is) throws java.io.IOExceptionRead a word from an input stream- Throws:
java.io.IOException
-
readDword
public static int readDword(java.io.InputStream is) throws java.io.IOExceptionRead a dword from an input stream- Throws:
java.io.IOException
-
readSdword
public static int readSdword(java.io.InputStream is) throws java.io.IOExceptionRead a signed dword from an input stream- Throws:
java.io.IOException
-
readLong
public static java.lang.Long readLong(java.io.InputStream is) throws java.io.IOExceptionRead a Long from an input stream- Throws:
java.io.IOException
-
readString
public static java.lang.String readString(java.io.InputStream is) throws java.io.IOExceptionRead a String from an input stream- Throws:
java.io.IOException
-
readByteArray
public static byte[] readByteArray(java.io.InputStream is) throws java.io.IOExceptionRead a byte array from an input stream- Throws:
java.io.IOException
-
readfloat
public static float readfloat(java.io.InputStream os) throws java.io.IOExceptionRead a float value from an input stream- Throws:
java.io.IOException
-
addShutdownHook
public static void addShutdownHook(IShutdownHook hook)
Add a cleanup hook to the list. These hooks will be evaluated in the reverse order than the order in which they were added.- Parameters:
hook- is the shutdown hook that needs to be added to the sequence.
-
addPollingHook
public static void addPollingHook(IPollingHook hook)
Add a polling hook to the list. These hooks will be evaluated in the order they were added.- Parameters:
hook- is the polling hook that needs to be added to the sequence.
-
pollAll
public static void pollAll(IThreadContext threadContext) throws ManifoldCFException
Poll all the registered polling services.- Throws:
ManifoldCFException
-
createResourceLoader
public static ManifoldCFResourceLoader createResourceLoader() throws ManifoldCFException
Create a new resource loader based on the default one. This is used by connectors wishing to make their own resource loaders for isolation purposes.- Throws:
ManifoldCFException
-
findClass
public static java.lang.Class findClass(java.lang.String cname) throws java.lang.ClassNotFoundException, ManifoldCFExceptionLocate a class in the configuration-determined class path. This method is designed for loading plugin classes, and their downstream dependents.- Throws:
java.lang.ClassNotFoundExceptionManifoldCFException
-
cleanUpEnvironment
@Deprecated public static void cleanUpEnvironment()
Deprecated.Perform system shutdown, minting thread context for backwards compatibility
-
cleanUpEnvironment
public static void cleanUpEnvironment(IThreadContext threadContext)
Perform system shutdown, using the registered shutdown hooks.
-
-