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
Sally4
sally4-servlet
Commits
dedb624c
Commit
dedb624c
authored
May 06, 2014
by
Constantin Jucovschi
Browse files
updates
parent
b05ab954
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/info/kwarc/sally4/servlet/SallyServlet.java
View file @
dedb624c
...
...
@@ -2,4 +2,5 @@ package info.kwarc.sally4.servlet;
public
interface
SallyServlet
{
String
getURL
();
}
src/main/java/info/kwarc/sally4/servlet/impl/ServletImpl.java
View file @
dedb624c
...
...
@@ -10,13 +10,16 @@ import org.apache.camel.component.servlet.ServletComponent;
import
org.apache.felix.ipojo.annotations.Component
;
import
org.apache.felix.ipojo.annotations.Instantiate
;
import
org.apache.felix.ipojo.annotations.Invalidate
;
import
org.apache.felix.ipojo.annotations.Property
;
import
org.apache.felix.ipojo.annotations.Provides
;
import
org.apache.felix.ipojo.annotations.Requires
;
import
org.apache.felix.ipojo.annotations.Validate
;
import
org.osgi.service.http.HttpService
;
import
org.osgi.service.http.NamespaceException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
@Component
@Component
(
managedservice
=
"sally"
)
@Provides
@Instantiate
public
class
ServletImpl
implements
SallyServlet
{
...
...
@@ -27,6 +30,11 @@ public class ServletImpl implements SallyServlet {
@Requires
CamelContextProvider
camelContextProvider
;
@Property
(
name
=
"SallyURL"
)
String
SallyURL
;
Logger
log
=
LoggerFactory
.
getLogger
(
getClass
());
@Validate
public
void
start
()
throws
ServletException
,
NamespaceException
{
CamelHttpTransportServlet
srvlet
=
new
CamelHttpTransportServlet
();
...
...
@@ -35,7 +43,6 @@ public class ServletImpl implements SallyServlet {
ServletComponent
servletComponent
=
new
ServletComponent
();
servletComponent
.
setServletName
(
srvlet
.
getServletName
());
camelContextProvider
.
registerGlobalComponent
(
"sallyservlet"
,
servletComponent
);
}
@Invalidate
...
...
@@ -44,4 +51,9 @@ public class ServletImpl implements SallyServlet {
camelContextProvider
.
unregisterGlobalComponent
(
"sallyservlet"
);
}
@Override
public
String
getURL
()
{
return
SallyURL
+
"/sally"
;
}
}
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