Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
joram
joram
Commits
7a2c26ab
Commit
7a2c26ab
authored
Mar 31, 2022
by
Andre Freyssinet
Browse files
Prints the exception message in case of error during a service starting.
parent
e9011a19
Changes
1
Hide whitespace changes
Inline
Side-by-side
joram/a3/rt/src/main/java/fr/dyade/aaa/agent/ServiceManager.java
View file @
7a2c26ab
/*
* Copyright (C) 2001 - 202
1
ScalAgent Distributed Technologies
* Copyright (C) 2001 - 202
2
ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 BULL
* Copyright (C) 1996 - 2000 INRIA
*
...
...
@@ -22,6 +22,7 @@ package fr.dyade.aaa.agent;
import
java.io.IOException
;
import
java.io.Serializable
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
import
java.util.Enumeration
;
import
java.util.HashSet
;
...
...
@@ -161,13 +162,20 @@ public class ServiceManager implements Serializable {
if
(
desc
.
running
)
throw
new
Exception
(
"Service already running"
);
Class
ptypes
[]
=
new
Class
[]
{
String
.
class
,
Boolean
.
TYPE
};
Object
args
[]
=
new
Object
[]
{
desc
.
getArguments
(),
new
Boolean
(!
desc
.
isInitialized
())
};
Object
args
[]
=
new
Object
[]
{
desc
.
getArguments
(),
Boolean
.
valueOf
(!
desc
.
isInitialized
())
};
Class
service
=
null
;
service
=
Class
.
forName
(
desc
.
getClassName
());
Method
init
=
service
.
getMethod
(
"init"
,
ptypes
);
init
.
invoke
(
null
,
args
);
try
{
init
.
invoke
(
null
,
args
);
}
catch
(
InvocationTargetException
exc
)
{
if
(
xlogmon
.
isLoggable
(
BasicLevel
.
DEBUG
))
xlogmon
.
log
(
BasicLevel
.
DEBUG
,
getName
()
+
", cannot start service:"
,
exc
.
getCause
());
throw
new
Exception
(
exc
.
getCause
().
getMessage
());
}
desc
.
running
=
true
;
desc
.
initialized
=
true
;
...
...
Write
Preview
Supports
Markdown
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