public class PayaraMicroImpl extends Object implements PayaraMicroBoot
Modifier and Type | Method and Description |
---|---|
PayaraMicroImpl |
addDeployFromGAV(String GAV)
Adds a Maven GAV coordinate to the list of archives to be deployed at
boot.
|
PayaraMicroImpl |
addDeployment(String pathToWar)
Adds an archive to the list of archives to be deployed at boot.
|
PayaraMicroImpl |
addDeploymentFile(File file)
Adds an archive to the list of archives to be deployed at boot.
|
PayaraMicroImpl |
addLibrary(File lib)
Adds the library to the classloader and loads it
|
PayaraMicroImpl |
addRepoUrl(String... URLs)
Adds a Maven repository to the list of repositories to search for
artifacts in
|
static PayaraMicroRuntime |
bootstrap()
Bootstraps the PayaraMicroRuntime with all defaults and no additional
configuration.
|
PayaraMicroRuntime |
bootStrap()
Boots the Payara Micro Server.
|
static PayaraMicroBoot |
create(String[] args) |
File |
getAlternateDomainXML()
The path to an alternative domain.xml for PayaraMicro to use at boot
|
int |
getAutoBindRange()
Gets the maximum number of ports to check if free for autobinding
purposes
|
String |
getClusterMulticastGroup()
Gets the cluster group
|
int |
getClusterPort()
Gets the cluster multicast port used for cluster communications
|
int |
getClusterStartPort()
Gets the instance listen port number used by clustering.
|
File |
getDeploymentDir()
A directory which will be scanned for archives to deploy
|
boolean |
getHttpAutoBind()
Indicates whether autobinding of the HTTP port is enabled
|
int |
getHttpPort()
The configured port Payara Micro will use for HTTP requests.
|
String |
getHzClusterName()
Gets the name of the Hazelcast cluster group.
|
String |
getHzClusterPassword()
Gets the password of the Hazelcast cluster group
|
static PayaraMicroImpl |
getInstance()
Obtains the static singleton instance of the Payara Micro Server.
|
static PayaraMicroImpl |
getInstance(boolean create) |
String |
getInstanceGroup()
Gets the name of the instance group
|
String |
getInstanceName()
Gets the logical name for this PayaraMicro Server within the server
cluster
|
int |
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
10
|
File |
getRootDir()
The File path to a directory that PayaraMicro should use for storing its
configuration files
|
PayaraMicroRuntimeImpl |
getRuntime()
Get a handle on the running Payara instance to manipulate the server once
running
|
boolean |
getSslAutoBind()
Indicates whether autobinding of the HTTPS port is enabled
|
String |
getSslCert()
The name of the SSL certificate to use in the keystore
|
int |
getSslPort()
The configured port for HTTPS requests
|
File |
getUberJar()
The UberJar to create
|
boolean |
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 enabled
|
static void |
main(String[] args)
Runs a Payara Micro server used via java -jar payara-micro.jar
|
PayaraMicroBoot |
setAccessLogDir(String filePath)
Set user defined file directory for the access log
|
PayaraMicroBoot |
setAccessLogFormat(String format)
Set user defined formatting for the access log
|
PayaraMicroBoot |
setAccessLogInterval(int interval)
Set user defined interval for the access log
|
PayaraMicroImpl |
setAlternateDomainXML(File alternateDomainXML)
Sets the path to a domain.xml file PayaraMicro should use to boot.
|
PayaraMicroImpl |
setApplicationDomainXML(String domainXml)
Sets an application specific domain.xml file that is embedded on the
classpath of your application.
|
PayaraMicroImpl |
setAutoBindRange(int autoBindRange)
Sets the maximum number of ports to check if free for autobinding
purposes
|
PayaraMicroImpl |
setClusterMulticastGroup(String hzMulticastGroup)
Sets the cluster group used for Payara Micro clustering used for cluster
communications and discovery.
|
PayaraMicroImpl |
setClusterPort(int hzPort)
Sets the multicast group used for Payara Micro clustering used for
cluster communication and discovery.
|
PayaraMicroImpl |
setClusterStartPort(int hzStartPort)
Sets the start port number for the Payara Micro to listen on for cluster
communications.
|
PayaraMicroImpl |
setDeploymentDir(File deploymentRoot)
Sets a directory to scan for archives to deploy on boot.
|
PayaraMicroImpl |
setHttpAutoBind(boolean httpAutoBind)
Enables or disables autobinding of the HTTP port
|
PayaraMicroImpl |
setHttpPort(int httpPort)
Sets the port used for HTTP requests
|
PayaraMicroImpl |
setHzClusterName(String hzClusterName)
Sets the name of the Hazelcast cluster group
|
PayaraMicroImpl |
setHzClusterPassword(String hzClusterPassword)
Sets the Hazelcast cluster group password.
|
PayaraMicroImpl |
setInstanceGroup(String instanceGroup)
Sets the instance group name
|
PayaraMicroImpl |
setInstanceName(String instanceName)
Sets the logical instance name for this PayaraMicro server within the
server cluster If this is not set a name is generated
|
PayaraMicroImpl |
setLite(boolean liteMember)
Sets the lite status of this cluster member.
|
PayaraMicroImpl |
setLogoFile(String filePath)
Sets the path to the logo file printed at boot.
|
PayaraMicroImpl |
setLogPropertiesFile(File fileName)
Set user defined properties file for logging
|
PayaraMicroImpl |
setMaxHttpThreads(int maxHttpThreads)
The maximum threads in the HTTP(S) threadpool processing HTTP(S)
requests.
|
PayaraMicroImpl |
setMinHttpThreads(int minHttpThreads)
The minimum number of threads in the HTTP(S) threadpool Default value is
10
|
PayaraMicroImpl |
setNoCluster(boolean noCluster)
Enables or disables clustering before bootstrap
|
PayaraMicroBoot |
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.
|
PayaraMicroImpl |
setPrintLogo(boolean generate)
Set whether the logo should be generated on boot
|
PayaraMicroImpl |
setRootDir(File rootDir)
Sets the File path to a directory PayaraMicro should use to install its
configuration files.
|
PayaraMicroImpl |
setSniEnabled(boolean value)
Sets whether SNI enabled for SSL
|
PayaraMicroImpl |
setSslAutoBind(boolean sslAutoBind)
Enables or disables autobinding of the HTTPS port
|
PayaraMicroImpl |
setSslCert(String alias)
Set the certificate alias in the keystore to use for the server cert
|
PayaraMicroImpl |
setSslPort(int sslPort)
Sets the configured port for HTTPS requests.
|
PayaraMicroImpl |
setUserLogFile(String fileName)
Set user defined file for the Log entries
|
void |
shutdown()
Stops and then shutsdown the Payara Micro Server
|
public static void main(String[] args) throws Exception
args
- Command line arguments for PayaraMicro Usage: --help to see
all the options
BootstrapException
- If there is a problem booting the serverException
public static PayaraMicroBoot create(String[] args) throws Exception
Exception
public static PayaraMicroImpl getInstance()
public static PayaraMicroRuntime bootstrap() throws BootstrapException
BootstrapException
public static PayaraMicroImpl getInstance(boolean create)
create
- If false the instance won't be created if it has not been
initialisedpublic String getClusterMulticastGroup()
getClusterMulticastGroup
in interface PayaraMicroBoot
public PayaraMicroImpl setClusterMulticastGroup(String hzMulticastGroup)
setClusterMulticastGroup
in interface PayaraMicroBoot
hzMulticastGroup
- String representation of the multicast grouppublic PayaraMicroImpl setLogoFile(String filePath)
setLogoFile
in interface PayaraMicroBoot
filePath
- public PayaraMicroImpl setPrintLogo(boolean generate)
setPrintLogo
in interface PayaraMicroBoot
generate
- public PayaraMicroImpl setUserLogFile(String fileName)
setUserLogFile
in interface PayaraMicroBoot
fileName
- public PayaraMicroImpl setLogPropertiesFile(File fileName)
setLogPropertiesFile
in interface PayaraMicroBoot
fileName
- public PayaraMicroBoot setAccessLogDir(String filePath)
setAccessLogDir
in interface PayaraMicroBoot
filePath
- public PayaraMicroBoot setAccessLogFormat(String format)
setAccessLogFormat
in interface PayaraMicroBoot
format
- public PayaraMicroBoot setAccessLogInterval(int interval)
interval
- public int getClusterPort()
getClusterPort
in interface PayaraMicroBoot
public PayaraMicroImpl setClusterPort(int hzPort)
setClusterPort
in interface PayaraMicroBoot
hzPort
- The port numberpublic int getClusterStartPort()
getClusterStartPort
in interface PayaraMicroBoot
public PayaraMicroImpl setClusterStartPort(int hzStartPort)
setClusterStartPort
in interface PayaraMicroBoot
hzStartPort
- Start port numberpublic int getHttpPort()
getHttpPort
in interface PayaraMicroBoot
public PayaraMicroImpl setHttpPort(int httpPort)
setHttpPort
in interface PayaraMicroBoot
httpPort
- The port numberpublic File getUberJar()
getUberJar
in interface PayaraMicroBoot
public int getSslPort()
getSslPort
in interface PayaraMicroBoot
public PayaraMicroImpl setSslPort(int sslPort)
setSslPort
in interface PayaraMicroBoot
sslPort
- The HTTPS portpublic PayaraMicroImpl setSniEnabled(boolean value)
PayaraMicroBoot
setSniEnabled
in interface PayaraMicroBoot
value
- true to enable SNIpublic PayaraMicroImpl setSslCert(String alias)
setSslCert
in interface PayaraMicroBoot
alias
- name of the certificate in the keystorepublic String getSslCert()
PayaraMicroBoot
getSslCert
in interface PayaraMicroBoot
public String getInstanceName()
getInstanceName
in interface PayaraMicroBoot
public PayaraMicroImpl setInstanceName(String instanceName)
setInstanceName
in interface PayaraMicroBoot
instanceName
- The logical server namepublic File getDeploymentDir()
getDeploymentDir
in interface PayaraMicroBoot
public PayaraMicroImpl setDeploymentDir(File deploymentRoot)
setDeploymentDir
in interface PayaraMicroBoot
deploymentRoot
- File path to the directorypublic File getAlternateDomainXML()
getAlternateDomainXML
in interface PayaraMicroBoot
public PayaraMicroImpl setApplicationDomainXML(String domainXml)
setApplicationDomainXML
in interface PayaraMicroBoot
domainXml
- This is a resource string for your domain.xmlpublic PayaraMicroImpl setAlternateDomainXML(File alternateDomainXML)
setAlternateDomainXML
in interface PayaraMicroBoot
alternateDomainXML
- public PayaraMicroImpl addDeployment(String pathToWar)
addDeployment
in interface PayaraMicroBoot
pathToWar
- File path to the deployment archivepublic PayaraMicroImpl addDeploymentFile(File file)
addDeploymentFile
in interface PayaraMicroBoot
file
- File path to the deployment archivepublic PayaraMicroImpl addDeployFromGAV(String GAV)
addDeployFromGAV
in interface PayaraMicroBoot
GAV
- GAV coordinatepublic PayaraMicroImpl addRepoUrl(String... URLs)
addRepoUrl
in interface PayaraMicroBoot
URLs
- URL to Maven repositorypublic boolean isNoCluster()
isNoCluster
in interface PayaraMicroBoot
public PayaraMicroImpl setNoCluster(boolean noCluster)
setNoCluster
in interface PayaraMicroBoot
noCluster
- set to true to disable clusteringpublic boolean isLite()
isLite
in interface PayaraMicroBoot
public PayaraMicroImpl setLite(boolean liteMember)
setLite
in interface PayaraMicroBoot
liteMember
- set to true to set as a lite cluster member with no
data storagepublic int getMaxHttpThreads()
getMaxHttpThreads
in interface PayaraMicroBoot
public PayaraMicroImpl setMaxHttpThreads(int maxHttpThreads)
setMaxHttpThreads
in interface PayaraMicroBoot
maxHttpThreads
- Maximum threads in the HTTP(S) threadpoolpublic int getMinHttpThreads()
getMinHttpThreads
in interface PayaraMicroBoot
public PayaraMicroImpl setMinHttpThreads(int minHttpThreads)
setMinHttpThreads
in interface PayaraMicroBoot
minHttpThreads
- public File getRootDir()
getRootDir
in interface PayaraMicroBoot
public PayaraMicroImpl setRootDir(File rootDir)
setRootDir
in interface PayaraMicroBoot
rootDir
- Path to a valid directorypublic boolean getHttpAutoBind()
getHttpAutoBind
in interface PayaraMicroBoot
public PayaraMicroImpl setHttpAutoBind(boolean httpAutoBind)
setHttpAutoBind
in interface PayaraMicroBoot
httpAutoBind
- The true or false value to enable or disable HTTP
autobindingpublic boolean getSslAutoBind()
getSslAutoBind
in interface PayaraMicroBoot
public PayaraMicroImpl setSslAutoBind(boolean sslAutoBind)
setSslAutoBind
in interface PayaraMicroBoot
sslAutoBind
- The true or false value to enable or disable HTTPS
autobindingpublic int getAutoBindRange()
getAutoBindRange
in interface PayaraMicroBoot
public PayaraMicroImpl setAutoBindRange(int autoBindRange)
setAutoBindRange
in interface PayaraMicroBoot
autoBindRange
- The maximum number of ports to increment the port
value bypublic String getHzClusterName()
getHzClusterName
in interface PayaraMicroBoot
public PayaraMicroImpl setHzClusterName(String hzClusterName)
setHzClusterName
in interface PayaraMicroBoot
hzClusterName
- The name of the hazelcast clusterpublic String getHzClusterPassword()
getHzClusterPassword
in interface PayaraMicroBoot
public PayaraMicroImpl setHzClusterPassword(String hzClusterPassword)
setHzClusterPassword
in interface PayaraMicroBoot
hzClusterPassword
- The password to setpublic String getInstanceGroup()
getInstanceGroup
in interface PayaraMicroBoot
public PayaraMicroImpl setInstanceGroup(String instanceGroup)
setInstanceGroup
in interface PayaraMicroBoot
instanceGroup
- The instance group namepublic PayaraMicroRuntime bootStrap() throws BootstrapException
bootStrap
in interface PayaraMicroBoot
BootstrapException
public PayaraMicroRuntimeImpl getRuntime() throws IllegalStateException
getRuntime
in interface PayaraMicroBoot
IllegalStateException
public void shutdown() throws BootstrapException
shutdown
in interface PayaraMicroBoot
BootstrapException
public PayaraMicroImpl addLibrary(File lib)
PayaraMicroBoot
addLibrary
in interface PayaraMicroBoot
lib
- The library to addpublic PayaraMicroBoot setPreBootHandler(Consumer<AdminCommandRunner> handler)
PayaraMicroBoot
AdminCommandRunner
before instance starts.
It offers way of changing domain configuration by means of running command set
.
The commands will be only executed on the instance that is booted.
Only single handler can be registered.setPreBootHandler
in interface PayaraMicroBoot
public PayaraMicroBoot setPostBootHandler(Consumer<AdminCommandRunner> handler)
PayaraMicroBoot
AdminCommandRunner
after all services start, but before deployment starts.
All commands available over asadmin
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 registeredsetPostBootHandler
in interface PayaraMicroBoot
Copyright © 2020. All rights reserved.