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

updates

parent b05ab954
...@@ -2,4 +2,5 @@ package info.kwarc.sally4.servlet; ...@@ -2,4 +2,5 @@ package info.kwarc.sally4.servlet;
public interface SallyServlet { public interface SallyServlet {
String getURL();
} }
...@@ -10,13 +10,16 @@ import org.apache.camel.component.servlet.ServletComponent; ...@@ -10,13 +10,16 @@ import org.apache.camel.component.servlet.ServletComponent;
import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Instantiate; import org.apache.felix.ipojo.annotations.Instantiate;
import org.apache.felix.ipojo.annotations.Invalidate; 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.Provides;
import org.apache.felix.ipojo.annotations.Requires; import org.apache.felix.ipojo.annotations.Requires;
import org.apache.felix.ipojo.annotations.Validate; import org.apache.felix.ipojo.annotations.Validate;
import org.osgi.service.http.HttpService; import org.osgi.service.http.HttpService;
import org.osgi.service.http.NamespaceException; import org.osgi.service.http.NamespaceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component @Component(managedservice="sally")
@Provides @Provides
@Instantiate @Instantiate
public class ServletImpl implements SallyServlet { public class ServletImpl implements SallyServlet {
...@@ -26,7 +29,12 @@ public class ServletImpl implements SallyServlet { ...@@ -26,7 +29,12 @@ public class ServletImpl implements SallyServlet {
@Requires @Requires
CamelContextProvider camelContextProvider; CamelContextProvider camelContextProvider;
@Property(name="SallyURL")
String SallyURL;
Logger log = LoggerFactory.getLogger(getClass());
@Validate @Validate
public void start() throws ServletException, NamespaceException { public void start() throws ServletException, NamespaceException {
CamelHttpTransportServlet srvlet = new CamelHttpTransportServlet(); CamelHttpTransportServlet srvlet = new CamelHttpTransportServlet();
...@@ -35,7 +43,6 @@ public class ServletImpl implements SallyServlet { ...@@ -35,7 +43,6 @@ public class ServletImpl implements SallyServlet {
ServletComponent servletComponent = new ServletComponent(); ServletComponent servletComponent = new ServletComponent();
servletComponent.setServletName(srvlet.getServletName()); servletComponent.setServletName(srvlet.getServletName());
camelContextProvider.registerGlobalComponent("sallyservlet", servletComponent); camelContextProvider.registerGlobalComponent("sallyservlet", servletComponent);
} }
@Invalidate @Invalidate
...@@ -44,4 +51,9 @@ public class ServletImpl implements SallyServlet { ...@@ -44,4 +51,9 @@ public class ServletImpl implements SallyServlet {
camelContextProvider.unregisterGlobalComponent("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