Skip to content

Instantly share code, notes, and snippets.

View sauthieg's full-sized avatar

Guillaume Sauthier sauthieg

View GitHub Profile
<ipojo>
<instance component="GenericFactory">
<property name="classname"
value="toto.MaClasse" />
</instance>
</ipojo>
@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 ...
}
}
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;
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;
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.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;