Package org.pentaho.platform.osgi
Class KarafInstance
- java.lang.Object
-
- org.pentaho.platform.osgi.KarafInstance
-
public class KarafInstance extends Object
This class assigns and configures property settings for separate karaf instances so that multiple client/server applications can run simultaneously on the same host. It assigns/creates a unique cache folder for each karaf instance and maintains what folders are in use by implementing a lock file.- Author:
- tkafalas
-
-
Field Summary
Fields Modifier and Type Field Description protected static IKarafInstanceResolverresolver
-
Constructor Summary
Constructors Constructor Description KarafInstance(String root, String clientType)KarafInstance(String root, String instanceFilePath, String clientType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassignPortsAndCreateCache()voidclose()StringgetCachePath()StringgetClientType()intgetInstanceNumber()KarafInstancePortgetPort(String id)Set<String>getPortIds()List<KarafInstancePort>getPorts()protected static IKarafInstanceResolvergetResolver()voidprocessConfigFile()voidregisterPort(KarafInstancePort instancePort)voidsetCacheLock(FileLock cacheLock)voidsetCachePath(String cachePath)voidsetInstanceNumber(Integer instanceNumber)voidsetInstanceSocket(ServerSocket instanceSocket)
-
-
-
Field Detail
-
resolver
protected static IKarafInstanceResolver resolver
-
-
Method Detail
-
setCachePath
public void setCachePath(String cachePath)
-
processConfigFile
public void processConfigFile() throws FileNotFoundException- Throws:
FileNotFoundException
-
getResolver
protected static IKarafInstanceResolver getResolver()
-
assignPortsAndCreateCache
public void assignPortsAndCreateCache() throws KarafInstanceResolverException- Throws:
KarafInstanceResolverException
-
close
public void close() throws IOException- Throws:
IOException
-
getInstanceNumber
public int getInstanceNumber()
-
getCachePath
public String getCachePath()
-
registerPort
public void registerPort(KarafInstancePort instancePort)
-
getPort
public KarafInstancePort getPort(String id)
-
getPorts
public List<KarafInstancePort> getPorts()
-
setInstanceNumber
public void setInstanceNumber(Integer instanceNumber)
-
setInstanceSocket
public void setInstanceSocket(ServerSocket instanceSocket)
-
getClientType
public String getClientType()
-
setCacheLock
public void setCacheLock(FileLock cacheLock)
-
-