Commit dedb624c authored by Constantin Jucovschi's avatar Constantin Jucovschi
Browse files

updates

parent b05ab954
......@@ -2,4 +2,5 @@ package info.kwarc.sally4.servlet;
public interface SallyServlet {
String getURL();
}
......@@ -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 {
......@@ -26,7 +29,12 @@ 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";
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment