Skip to content

Instantly share code, notes, and snippets.

View sauthieg's full-sized avatar

Guillaume Sauthier sauthieg

View GitHub Profile
package org.ow2.jonas.ipojo.guice.internal;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.felix.ipojo.ConfigurationException;
import org.apache.felix.ipojo.Pojo;
import org.apache.felix.ipojo.PrimitiveHandler;
Welcome to Felix
================
-> Start SampleModule
Start AnotherModule
InjectorComponent created
bindModule: sample-module
updateStatus >[com.google.inject.Module]< = >org.ow2.jonas.ipojo.guice.example.module.SampleModule@141b571<
bindModule: another-module
package org.ow2.osgi.scanner.internal;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
package org.jboss.weld.environment.osgi.extension;
import org.osgi.framework.BundleContext;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Any;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
@sauthieg
sauthieg / TrainingComponentProposal.java
Created March 14, 2011 13:48
Pseudo code, it's only the concept, it probably doesn't event compile !
Dialog trainingQuestion = new Dialog(TrainingComponentEvent.TOPIC,
"Do you want to start training?",
new String [] {"Yes", "No"}) {
public void handleAnswer(int answerId) {
IWorkingMemory memory = workingMemoryPool.get("demonstrator");
UserAnswer answer = new UserAnswer(this.getQuestionId(), answerId);
memory.insert(answer);
// fact insertion will trigger the rule evaluation ...
}
}
<ipojo>
<instance component="GenericFactory">
<property name="classname"
value="toto.MaClasse" />
</instance>
</ipojo>
@sauthieg
sauthieg / clone-ow2-utilities.sh
Created July 25, 2012 14:43
Usage: clone-ow2-utilities.sh [--ssh]
#! /bin/sh
wget http://gitorious.ow2.org/ow2-utilities.xml
option=$1
for tag in clone_url; do
repositories=`grep $tag ow2-utilities.xml \
| tr -d [\ ] \
| sed 's/^<.*>\([^<].*\)<.*>$/\1/'`
"[iPOJO] pool-1-thread-3" daemon prio=5 tid=7fb5561c6000 nid=0x1169a9000 in Object.wait() [1169a8000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f45193a0> (a [Ljava.lang.Object;)
at java.lang.Object.wait(Object.java:485)
at org.apache.felix.framework.Felix.acquireBundleLock(Felix.java:4481)
- locked <7f45193a0> (a [Ljava.lang.Object;)
at org.apache.felix.framework.Felix.registerService(Felix.java:2676)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:252)
at org.apache.felix.ipojo.IPojoContext.registerService(IPojoContext.java:385)
guillaume@shelbie$ shelbie:help
gogo (16)
format
getopt
new
set
tac
type
if
not
@sauthieg
sauthieg / hello-world.json
Created September 25, 2014 08:45
Returns "Hello World" when `http://localhost:8080/hello` is invoked
{
"heap": {
"objects": [
{
"name": "Hello",
"type": "StaticResponseHandler",
"config": {
"status": 200,
"entity": "<html><body><h1>Hello World</h1></body></html>"
}