Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
07b73477
Commit
07b73477
authored
Feb 04, 2015
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #172 from tevans/OF-877
OF-877: Cleanup BOSH start/stop/restart
parents
6d0283c6
7b2d581a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
68 deletions
+11
-68
HttpBindManager.java
src/java/org/jivesoftware/openfire/http/HttpBindManager.java
+11
-68
No files found.
src/java/org/jivesoftware/openfire/http/HttpBindManager.java
View file @
07b73477
...
...
@@ -167,7 +167,6 @@ public final class HttpBindManager {
PropertyEventDispatcher
.
addListener
(
new
HttpServerPropertyListener
());
this
.
httpSessionManager
=
new
HttpSessionManager
();
contexts
=
new
ContextHandlerCollection
();
// setup the cache for the allowed origins
this
.
setupAllowedOriginsMap
();
...
...
@@ -186,6 +185,7 @@ public final class HttpBindManager {
try
{
httpBindServer
.
start
();
Log
.
info
(
"HTTP bind service started"
);
}
catch
(
Exception
e
)
{
Log
.
error
(
"Error starting HTTP bind service"
,
e
);
...
...
@@ -198,10 +198,12 @@ public final class HttpBindManager {
if
(
httpBindServer
!=
null
)
{
try
{
httpBindServer
.
stop
();
Log
.
info
(
"HTTP bind service stopped"
);
}
catch
(
Exception
e
)
{
Log
.
error
(
"Error stoping HTTP bind service"
,
e
);
Log
.
error
(
"Error stop
p
ing HTTP bind service"
,
e
);
}
httpBindServer
=
null
;
}
}
...
...
@@ -486,9 +488,6 @@ public final class HttpBindManager {
* @throws Exception when there is an error configuring the HTTP binding ports.
*/
public
void
setHttpBindPorts
(
int
unsecurePort
,
int
securePort
)
throws
Exception
{
changeHttpBindPorts
(
unsecurePort
,
securePort
);
bindPort
=
unsecurePort
;
bindSecurePort
=
securePort
;
if
(
unsecurePort
!=
HTTP_BIND_PORT_DEFAULT
)
{
JiveGlobals
.
setProperty
(
HTTP_BIND_PORT
,
String
.
valueOf
(
unsecurePort
));
}
...
...
@@ -503,28 +502,6 @@ public final class HttpBindManager {
}
}
private
synchronized
void
changeHttpBindPorts
(
int
unsecurePort
,
int
securePort
)
throws
Exception
{
if
(
unsecurePort
<
0
&&
securePort
<
0
)
{
throw
new
IllegalArgumentException
(
"At least one port must be greater than zero."
);
}
if
(
unsecurePort
==
securePort
)
{
throw
new
IllegalArgumentException
(
"Ports must be distinct."
);
}
if
(
httpBindServer
!=
null
)
{
try
{
httpBindServer
.
stop
();
}
catch
(
Exception
e
)
{
Log
.
error
(
"Error stopping http bind server"
,
e
);
}
}
configureHttpBindServer
(
unsecurePort
,
securePort
);
httpBindServer
.
start
();
}
/**
* Starts an HTTP Bind server on the specified port and secure port.
*
...
...
@@ -557,6 +534,7 @@ public final class HttpBindManager {
httpBindServer
.
addConnector
(
httpsConnector
);
}
contexts
=
new
ContextHandlerCollection
();
createBoshHandler
(
contexts
,
"/http-bind"
);
createCrossDomainHandler
(
contexts
,
"/crossdomain.xml"
);
loadStaticDirectory
(
contexts
);
...
...
@@ -616,23 +594,10 @@ public final class HttpBindManager {
private
void
doEnableHttpBind
(
boolean
shouldEnable
)
{
if
(
shouldEnable
&&
httpBindServer
==
null
)
{
try
{
changeHttpBindPorts
(
JiveGlobals
.
getIntProperty
(
HTTP_BIND_PORT
,
HTTP_BIND_PORT_DEFAULT
),
JiveGlobals
.
getIntProperty
(
HTTP_BIND_SECURE_PORT
,
HTTP_BIND_SECURE_PORT_DEFAULT
));
}
catch
(
Exception
e
)
{
Log
.
error
(
"Error configuring HTTP binding ports"
,
e
);
}
start
();
}
else
if
(!
shouldEnable
&&
httpBindServer
!=
null
)
{
try
{
httpBindServer
.
stop
();
}
catch
(
Exception
e
)
{
Log
.
error
(
"Error stopping HTTP bind service"
,
e
);
}
httpBindServer
=
null
;
stop
();
}
}
...
...
@@ -689,41 +654,19 @@ public final class HttpBindManager {
if
(
value
==
bindPort
)
{
return
;
}
try
{
changeHttpBindPorts
(
value
,
JiveGlobals
.
getIntProperty
(
HTTP_BIND_SECURE_PORT
,
HTTP_BIND_SECURE_PORT_DEFAULT
));
bindPort
=
value
;
}
catch
(
Exception
ex
)
{
Log
.
error
(
"Error setting HTTP bind ports"
,
ex
);
}
restartServer
();
}
private
void
setSecureHttpBindPort
(
int
value
)
{
if
(
value
==
bindSecurePort
)
{
return
;
}
try
{
changeHttpBindPorts
(
JiveGlobals
.
getIntProperty
(
HTTP_BIND_PORT
,
HTTP_BIND_PORT_DEFAULT
),
value
);
bindSecurePort
=
value
;
}
catch
(
Exception
ex
)
{
Log
.
error
(
"Error setting HTTP bind ports"
,
ex
);
}
restartServer
();
}
private
synchronized
void
restartServer
()
{
if
(
httpBindServer
!=
null
)
{
try
{
httpBindServer
.
stop
();
}
catch
(
Exception
e
)
{
Log
.
error
(
"Error stopping http bind server"
,
e
);
}
configureHttpBindServer
(
getHttpBindUnsecurePort
(),
getHttpBindSecurePort
());
}
stop
();
start
();
}
/** Listens for changes to Jive properties that affect the HTTP server manager. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment