Package fish.payara.micro.boot
Interface PayaraMicroBoot
-
- All Known Implementing Classes:
PayaraMicro
,PayaraMicroImpl
public interface PayaraMicroBoot
- Author:
- steve
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PayaraMicroBoot
addDeployFromGAV(String GAV)
Adds a Maven GAV coordinate to the list of archives to be deployed at boot.PayaraMicroBoot
addDeployment(String pathToWar)
Adds an archive to the list of archives to be deployed at boot.PayaraMicroBoot
addDeploymentFile(File file)
Adds an archive to the list of archives to be deployed at boot.PayaraMicroBoot
addLibrary(File lib)
Adds the library to the classloader and loads itPayaraMicroBoot
addRepoUrl(String... URLs)
Adds a Maven repository to the list of repositories to search for artifacts inPayaraMicroRuntime
bootStrap()
Boots the Payara Micro Server.File
getAlternateDomainXML()
The path to an alternative domain.xml for PayaraMicro to use at bootint
getAutoBindRange()
Gets the maximum number of ports to check if free for autobinding purposesString
getClusterMulticastGroup()
Gets the cluster groupint
getClusterPort()
Gets the cluster multicast port used for cluster communicationsint
getClusterStartPort()
Gets the instance listen port number used by clustering.File
getDeploymentDir()
A directory which will be scanned for archives to deployboolean
getHttpAutoBind()
Indicates whether autobinding of the HTTP port is enabledint
getHttpPort()
The configured port Payara Micro will use for HTTP requests.String
getHzClusterName()
Gets the name of the Hazelcast cluster group.String
getInstanceGroup()
Gets the name of the instance groupString
getInstanceName()
Gets the logical name for this PayaraMicro Server within the server clusterint
getMaxHttpThreads()
The maximum threads in the HTTP(S) threadpool processing HTTP(S) requests.int
getMinHttpThreads()
The minimum number of threads in the HTTP(S) threadpool Default value is 10File
getRootDir()
The File path to a directory that PayaraMicro should use for storing its configuration filesPayaraMicroRuntime
getRuntime()
Get a handle on the running Payara instance to manipulate the server once runningboolean
getSslAutoBind()
Indicates whether autobinding of the HTTPS port is enabledString
getSslCert()
The name of the SSL certificate to use in the keystoreint
getSslPort()
The configured port for HTTPS requestsFile
getUberJar()
The UberJar to createboolean
isLite()
Indicates whether this is a lite cluster member which means it stores no cluster data although it participates fully in the cluster.boolean
isNoCluster()
Indicated whether clustering is enabledPayaraMicroBoot
setAccessLogDir(String filePath)
Set user defined file directory for the access logPayaraMicroBoot
setAccessLogFormat(String format)
Set user defined formatting for the access logPayaraMicroBoot
setAlternateDomainXML(File alternateDomainXML)
Sets the path to a domain.xml file PayaraMicro should use to boot.PayaraMicroBoot
setApplicationDomainXML(String domainXml)
Sets an application specific domain.xml file that is embedded on the classpath of your application.PayaraMicroBoot
setAutoBindRange(int autoBindRange)
Sets the maximum number of ports to check if free for autobinding purposesPayaraMicroBoot
setClusterMulticastGroup(String hzMulticastGroup)
Sets the cluster group used for Payara Micro clustering used for cluster communications and discovery.PayaraMicroBoot
setClusterPort(int hzPort)
Sets the multicast group used for Payara Micro clustering used for cluster communication and discovery.PayaraMicroBoot
setClusterStartPort(int hzStartPort)
Sets the start port number for the Payara Micro to listen on for cluster communications.PayaraMicroBoot
setDeploymentDir(File deploymentRoot)
Sets a directory to scan for archives to deploy on boot.PayaraMicroBoot
setHttpAutoBind(boolean httpAutoBind)
Enables or disables autobinding of the HTTP portPayaraMicroBoot
setHttpPort(int httpPort)
Sets the port used for HTTP requestsPayaraMicroBoot
setHzClusterName(String hzClusterName)
Sets the name of the Hazelcast cluster groupPayaraMicroBoot
setInstanceGroup(String groupName)
Sets the instance group namePayaraMicroBoot
setInstanceName(String instanceName)
Sets the logical instance name for this PayaraMicro server within the server cluster If this is not set a UUID is generatedPayaraMicroBoot
setLite(boolean liteMember)
Sets the lite status of this cluster member.PayaraMicroBoot
setLogoFile(String filePath)
Sets the path to the logo file printed at boot.PayaraMicroBoot
setLogPropertiesFile(File fileName)
Set user defined properties file for loggingPayaraMicroBoot
setMaxHttpThreads(int maxHttpThreads)
The maximum threads in the HTTP(S) threadpool processing HTTP(S) requests.PayaraMicroBoot
setMinHttpThreads(int minHttpThreads)
The minimum number of threads in the HTTP(S) threadpool Default value is 10PayaraMicroBoot
setNoCluster(boolean noCluster)
Enables or disables clustering before bootstrapPayaraMicroBoot
setPostBootHandler(Consumer<AdminCommandRunner> handler)
Register a handler for executing admin commands at post-boot time.PayaraMicroBoot
setPreBootHandler(Consumer<AdminCommandRunner> handler)
Register a handler for executing admin commands at pre-boot time.PayaraMicroBoot
setPrintLogo(boolean generate)
Set whether the logo should be generated on bootPayaraMicroBoot
setRootDir(File rootDir)
Sets the File path to a directory PayaraMicro should use to install its configuration files.PayaraMicroBoot
setSniEnabled(boolean value)
Sets whether SNI enabled for SSLPayaraMicroBoot
setSslAutoBind(boolean sslAutoBind)
Enables or disables autobinding of the HTTPS portPayaraMicroBoot
setSslCert(String alias)
Sets the name of the certificate to use in the keystorePayaraMicroBoot
setSslPort(int sslPort)
Sets the configured port for HTTPS requests.PayaraMicroBoot
setUserLogFile(String fileName)
Set user defined file for the Log entriesvoid
shutdown()
Stops and then shutsdown the Payara Micro Server
-
-
-
Method Detail
-
addDeployFromGAV
PayaraMicroBoot addDeployFromGAV(String GAV)
Adds a Maven GAV coordinate to the list of archives to be deployed at boot.- Parameters:
GAV
- GAV coordinate- Returns:
-
addDeployment
PayaraMicroBoot addDeployment(String pathToWar)
Adds an archive to the list of archives to be deployed at boot. These archives are not monitored for changes during running so are not redeployed without restarting the server- Parameters:
pathToWar
- File path to the deployment archive- Returns:
-
addDeploymentFile
PayaraMicroBoot addDeploymentFile(File file)
Adds an archive to the list of archives to be deployed at boot. These archives are not monitored for changes during running so are not redeployed without restarting the server- Parameters:
file
- File path to the deployment archive- Returns:
-
addRepoUrl
PayaraMicroBoot addRepoUrl(String... URLs)
Adds a Maven repository to the list of repositories to search for artifacts in- Parameters:
URLs
- URL to Maven repository- Returns:
-
bootStrap
PayaraMicroRuntime bootStrap() throws BootstrapException
Boots the Payara Micro Server. All parameters are checked at this point- Returns:
- An instance of PayaraMicroRuntime that can be used to access the running server
- Throws:
BootstrapException
-
getAlternateDomainXML
File getAlternateDomainXML()
The path to an alternative domain.xml for PayaraMicro to use at boot- Returns:
- The path to the domain.xml
-
getAutoBindRange
int getAutoBindRange()
Gets the maximum number of ports to check if free for autobinding purposes- Returns:
- The number of ports to check if free
-
getClusterMulticastGroup
String getClusterMulticastGroup()
Gets the cluster group- Returns:
- The Multicast Group that will beused for the Hazelcast clustering
-
getClusterPort
int getClusterPort()
Gets the cluster multicast port used for cluster communications- Returns:
- The configured cluster port
-
getClusterStartPort
int getClusterStartPort()
Gets the instance listen port number used by clustering. This number will be incremented automatically if the port is unavailable due to another instance running on the same host,- Returns:
- The start port number
-
getDeploymentDir
File getDeploymentDir()
A directory which will be scanned for archives to deploy- Returns:
-
getHttpAutoBind
boolean getHttpAutoBind()
Indicates whether autobinding of the HTTP port is enabled- Returns:
-
getHttpPort
int getHttpPort()
The configured port Payara Micro will use for HTTP requests.- Returns:
- The HTTP port
-
getHzClusterName
String getHzClusterName()
Gets the name of the Hazelcast cluster group. Clusters with different names do not interact- Returns:
- The current Cluster Name
-
getInstanceName
String getInstanceName()
Gets the logical name for this PayaraMicro Server within the server cluster- Returns:
- The configured instance name
-
getMaxHttpThreads
int getMaxHttpThreads()
The maximum threads in the HTTP(S) threadpool processing HTTP(S) requests. Setting this will determine how many concurrent HTTP requests can be processed. The default value is 200. This value is shared by both HTTP and HTTP(S) requests.- Returns:
-
getMinHttpThreads
int getMinHttpThreads()
The minimum number of threads in the HTTP(S) threadpool Default value is 10- Returns:
- The minimum threads to be created in the threadpool
-
getRootDir
File getRootDir()
The File path to a directory that PayaraMicro should use for storing its configuration files- Returns:
-
getRuntime
PayaraMicroRuntime getRuntime() throws IllegalStateException
Get a handle on the running Payara instance to manipulate the server once running- Returns:
- Throws:
IllegalStateException
-
getSslAutoBind
boolean getSslAutoBind()
Indicates whether autobinding of the HTTPS port is enabled- Returns:
-
getSslPort
int getSslPort()
The configured port for HTTPS requests- Returns:
- The HTTPS port
-
getSslCert
String getSslCert()
The name of the SSL certificate to use in the keystore- Returns:
-
getUberJar
File getUberJar()
The UberJar to create- Returns:
-
isLite
boolean isLite()
Indicates whether this is a lite cluster member which means it stores no cluster data although it participates fully in the cluster.- Returns:
-
isNoCluster
boolean isNoCluster()
Indicated whether clustering is enabled- Returns:
-
setAccessLogDir
PayaraMicroBoot setAccessLogDir(String filePath)
Set user defined file directory for the access log- Parameters:
filePath
-
-
setAccessLogFormat
PayaraMicroBoot setAccessLogFormat(String format)
Set user defined formatting for the access log- Parameters:
format
-
-
setAlternateDomainXML
PayaraMicroBoot setAlternateDomainXML(File alternateDomainXML)
Sets the path to a domain.xml file PayaraMicro should use to boot. If this is not set PayaraMicro will use an appropriate domain.xml from within its jar file- Parameters:
alternateDomainXML
-- Returns:
-
setApplicationDomainXML
PayaraMicroBoot setApplicationDomainXML(String domainXml)
Sets an application specific domain.xml file that is embedded on the classpath of your application.- Parameters:
domainXml
- This is a resource string for your domain.xml- Returns:
-
setPreBootHandler
PayaraMicroBoot setPreBootHandler(Consumer<AdminCommandRunner> handler)
Register a handler for executing admin commands at pre-boot time. Handler will be called with reference toAdminCommandRunner
before instance starts. It offers way of changing domain configuration by means of running commandset
. The commands will be only executed on the instance that is booted. Only single handler can be registered.- Parameters:
handler
-- Returns:
-
setPostBootHandler
PayaraMicroBoot setPostBootHandler(Consumer<AdminCommandRunner> handler)
Register a handler for executing admin commands at post-boot time. Handler will be called with reference toAdminCommandRunner
after all services start, but before deployment starts. All commands available overasadmin
command are valid in this phase. The commands will be only executed on the instance starting up, not in any cluster it may have formed. Only single handler can be registered- Parameters:
handler
-- Returns:
-
setAutoBindRange
PayaraMicroBoot setAutoBindRange(int autoBindRange)
Sets the maximum number of ports to check if free for autobinding purposes- Parameters:
autoBindRange
- The maximum number of ports to increment the port value by- Returns:
-
setClusterMulticastGroup
PayaraMicroBoot setClusterMulticastGroup(String hzMulticastGroup)
Sets the cluster group used for Payara Micro clustering used for cluster communications and discovery. Each Payara Micro cluster should have different values for the MulticastGroup- Parameters:
hzMulticastGroup
- String representation of the multicast group- Returns:
-
setClusterPort
PayaraMicroBoot setClusterPort(int hzPort)
Sets the multicast group used for Payara Micro clustering used for cluster communication and discovery. Each Payara Micro cluster should have different values for the cluster port- Parameters:
hzPort
- The port number- Returns:
-
setClusterStartPort
PayaraMicroBoot setClusterStartPort(int hzStartPort)
Sets the start port number for the Payara Micro to listen on for cluster communications.- Parameters:
hzStartPort
- Start port number- Returns:
-
setDeploymentDir
PayaraMicroBoot setDeploymentDir(File deploymentRoot)
Sets a directory to scan for archives to deploy on boot. This directory is not monitored while running for changes. Therefore archives in this directory will NOT be redeployed during runtime.- Parameters:
deploymentRoot
- File path to the directory- Returns:
-
setHttpAutoBind
PayaraMicroBoot setHttpAutoBind(boolean httpAutoBind)
Enables or disables autobinding of the HTTP port- Parameters:
httpAutoBind
- The true or false value to enable or disable HTTP autobinding- Returns:
-
setHttpPort
PayaraMicroBoot setHttpPort(int httpPort)
Sets the port used for HTTP requests- Parameters:
httpPort
- The port number- Returns:
-
setHzClusterName
PayaraMicroBoot setHzClusterName(String hzClusterName)
Sets the name of the Hazelcast cluster group- Parameters:
hzClusterName
- The name of the hazelcast cluster- Returns:
-
setInstanceName
PayaraMicroBoot setInstanceName(String instanceName)
Sets the logical instance name for this PayaraMicro server within the server cluster If this is not set a UUID is generated- Parameters:
instanceName
- The logical server name- Returns:
-
setLite
PayaraMicroBoot setLite(boolean liteMember)
Sets the lite status of this cluster member. If true the Payara Micro is a lite cluster member which means it stores no cluster data.- Parameters:
liteMember
- set to true to set as a lite cluster member with no data storage- Returns:
-
setLogPropertiesFile
PayaraMicroBoot setLogPropertiesFile(File fileName)
Set user defined properties file for logging- Parameters:
fileName
-- Returns:
-
setLogoFile
PayaraMicroBoot setLogoFile(String filePath)
Sets the path to the logo file printed at boot. This can be on the classpath of the server or an absolute URL- Parameters:
filePath
-- Returns:
-
setMaxHttpThreads
PayaraMicroBoot setMaxHttpThreads(int maxHttpThreads)
The maximum threads in the HTTP(S) threadpool processing HTTP(S) requests. Setting this will determine how many concurrent HTTP requests can be processed. The default value is 200- Parameters:
maxHttpThreads
- Maximum threads in the HTTP(S) threadpool- Returns:
-
setMinHttpThreads
PayaraMicroBoot setMinHttpThreads(int minHttpThreads)
The minimum number of threads in the HTTP(S) threadpool Default value is 10- Parameters:
minHttpThreads
-- Returns:
-
setNoCluster
PayaraMicroBoot setNoCluster(boolean noCluster)
Enables or disables clustering before bootstrap- Parameters:
noCluster
- set to true to disable clustering- Returns:
-
setPrintLogo
PayaraMicroBoot setPrintLogo(boolean generate)
Set whether the logo should be generated on boot- Parameters:
generate
-- Returns:
-
setRootDir
PayaraMicroBoot setRootDir(File rootDir)
Sets the File path to a directory PayaraMicro should use to install its configuration files. If this is set the PayaraMicro configuration files will be stored in the directory and persist across server restarts. If this is not set the configuration files are created in a temporary location and not persisted across server restarts.- Parameters:
rootDir
- Path to a valid directory- Returns:
- Returns the PayaraMicro instance
-
setSslAutoBind
PayaraMicroBoot setSslAutoBind(boolean sslAutoBind)
Enables or disables autobinding of the HTTPS port- Parameters:
sslAutoBind
- The true or false value to enable or disable HTTPS autobinding- Returns:
-
setSslPort
PayaraMicroBoot setSslPort(int sslPort)
Sets the configured port for HTTPS requests. If this is not set HTTPS is disabled- Parameters:
sslPort
- The HTTPS port- Returns:
-
setSslCert
PayaraMicroBoot setSslCert(String alias)
Sets the name of the certificate to use in the keystore- Parameters:
alias
- the name of the certificate in the keystore- Returns:
-
setUserLogFile
PayaraMicroBoot setUserLogFile(String fileName)
Set user defined file for the Log entries- Parameters:
fileName
-- Returns:
-
setInstanceGroup
PayaraMicroBoot setInstanceGroup(String groupName)
Sets the instance group name- Parameters:
instanceGroup
- The instance group name- Returns:
-
getInstanceGroup
String getInstanceGroup()
Gets the name of the instance group- Returns:
- The name of the instance group
-
shutdown
void shutdown() throws BootstrapException
Stops and then shutsdown the Payara Micro Server- Throws:
BootstrapException
-
addLibrary
PayaraMicroBoot addLibrary(File lib)
Adds the library to the classloader and loads it- Parameters:
lib
- The library to add- Returns:
- Since:
- 4.1.2.173
-
setSniEnabled
PayaraMicroBoot setSniEnabled(boolean value)
Sets whether SNI enabled for SSL- Parameters:
value
- true to enable SNI- Returns:
- Since:
- 4.1.2.182 5.1.2.182
-
-