This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class WeldListener extends AbstractServletListener | |
| { | |
| ... | |
| @Override | |
| public void requestInitialized(ServletRequestEvent event) | |
| { | |
| String contextId = (String) event.getServletContext().getAttribute(Container.CONTEXT_ID_KEY); | |
| ... | |
| this.requestContextCache = Container.instance(contextId).deploymentManager().instance().select(HttpRequestContext.class).get(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <dependency> | |
| <groupId>org.jboss.weld.osgi</groupId> | |
| <artifactId>weld-osgi-core-api</artifactId> | |
| <version>1.1.3-SNAPSHOT</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>javax.inject</groupId> | |
| <artifactId>javax.inject</artifactId> | |
| <version>1</version> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Inject Bundle bundle; | |
| @Inject BundleContext context; | |
| @Inject @BundleHeaders Map<String, String> headers; | |
| @Inject @BundleHeader("Bundle-SymbolicName") String symbolicName; | |
| @Inject @BundleDataFile("text.txt") File text; | |
| @Publish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private InjectionTarget it; | |
| private AnnotatedType annotated; | |
| private BeanManager beanManager; | |
| public <T> T create(CreationalContext<T> creationalContext) { | |
| annotated = beanManager.createAnnotatedType(myType); | |
| it = manager.createInjectionTarget(annotated); | |
| T instance = (T) it.produce(creationalContext); | |
| it.inject(instance, creationalContext); | |
| it.postConstruct(instance); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tools.nsc.interpreter.Results._ | |
| import tools.nsc.interpreter.IMain | |
| import tools.nsc.Settings | |
| class ResultHolder(var value : Any) | |
| class ScalaInterpreter(settings: Settings) extends IMain(settings) { | |
| val writer = new java.io.StringWriter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Collection; | |
| import java.util.Properties; | |
| import org.osgi.framework.Bundle; | |
| import org.osgi.framework.BundleListener; | |
| import org.osgi.framework.ServiceListener; | |
| import org.osgi.framework.ServiceReference; | |
| import org.osgi.framework.ServiceRegistration; | |
| public interface OSGiBridge { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Embed-Dependency *; scope=compile; inline=true; artifactId=!cdi-osgi-api|cdi-osgi-impl|jboss-interceptor-api|javax.inject|jsr250-api|cdi-api|el-api, \ | |
| slf4j-jdk14; inline=true | |
| -exportcontents org.jboss.weld.context; \ | |
| org.jboss.weld.ejb; \ | |
| org.jboss.weld.bean; \ | |
| org.jboss.weld.bean.builtin; \ | |
| org.jboss.weld.bean.proxy; \ | |
| org.jboss.weld.environment.osgi; \ | |
| org.jboss.weld.environment.osgi.integration; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Export-Package org.osgi.cdi.impl; \ | |
| org.osgi.cdi.impl.extension; \ | |
| org.osgi.cdi.impl.extension.services; \ | |
| org.osgi.cdi.impl.integration | |
| Import-Package org.osgi.cdi.api.extension; \ | |
| org.osgi.cdi.api.extension.annotation; \ | |
| org.osgi.cdi.api.extension.events; \ | |
| org.osgi.cdi.api.integration; \ | |
| javax.inject; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Embed-Dependency *; scope=compile; inline=true; artifactId=!org.osgi.core, | |
| Export-Package org.osgi.cdi.api.extension; \ | |
| org.osgi.cdi.api.extension.annotation; \ | |
| org.osgi.cdi.api.extension.events; \ | |
| org.osgi.cdi.api.integration; \ | |
| javax.el; \ | |
| javax.inject; \ | |
| javax.decorator; \ | |
| javax.annotation; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ServiceListener { | |
| public void bindService(MyService service) { | |
| } | |
| public void unbindService(MyService service) { | |
| } | |
| } | |
| // with configuration |