Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Shervin Nourbakhsh
cameo
Commits
18b4869a
Commit
18b4869a
authored
Mar 04, 2020
by
legoc
Browse files
Factorised ServerImpl.start
parent
edf172e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
cameo-api/src/main/java/fr/ill/ics/cameo/impl/ServerImpl.java
View file @
18b4869a
...
...
@@ -244,35 +244,7 @@ public class ServerImpl extends ServicesImpl {
* @throws ConnectionTimeout
*/
public
InstanceImpl
start
(
String
name
,
int
options
,
String
instanceReference
)
{
boolean
outputStream
=
((
options
&
Option
.
OUTPUTSTREAM
)
!=
0
);
InstanceImpl
instance
=
new
InstanceImpl
(
this
);
// we set the name of the application and register before starting because the id is not available
instance
.
setName
(
name
);
registerEventListener
(
instance
);
try
{
// we connect to the stream port before starting the application
// so that we are sure that the ENDSTREAM message will be received even if the application terminates rapidly
if
(
outputStream
)
{
instance
.
setOutputStreamSocket
(
createOutputStreamSocket
(
getStreamPort
(
name
)));
}
Response
response
=
startApplication
(
name
,
null
,
instanceReference
);
if
(
response
.
getValue
()
==
-
1
)
{
instance
.
setErrorMessage
(
response
.
getMessage
());
}
else
{
instance
.
setId
(
response
.
getValue
());
}
}
catch
(
ConnectionTimeout
e
)
{
instance
.
setErrorMessage
(
e
.
getMessage
());
}
return
instance
;
return
start
(
name
,
null
,
options
,
instanceReference
);
}
public
InstanceImpl
start
(
String
name
,
String
serverEndpoint
)
{
...
...
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