This file contains 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
Weld weld = new Weld(); | |
WeldContainer container = weld.initialize(); | |
Instance<Object> instance = container.instance(); | |
instance.select(Mybean.class).get(); |
This file contains 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
package com.foo.loic; | |
import java.io.*; | |
import java.net.InetAddress; | |
import java.net.InetSocketAddress; | |
import java.net.Socket; | |
import java.net.SocketAddress; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.*; |
This file contains 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
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:cdi="http://www.jboss.org/schema/seam/spring" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | |
http://www.jboss.org/schema/seam/spring http://www.jboss.org/schema/seam/spring/seam-spring.xsd"> | |
<cdi:bean-reference id="cdiBean" type="org.jboss.seam.spring.test.injection.CdiBean"/> | |
<cdi:bean-reference id="thirdCdiBean" type="org.jboss.seam.spring.test.injection.ThirdCdiBean"> | |
<cdi:qualifier type="org.jboss.seam.spring.test.injection.CdiQualifierWithAttributes"> |
This file contains 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 Configuration { | |
public boolean loggingEnabled = false; | |
public boolean someOptimizationEnabled = false; | |
public boolean someStuffEnabled = false; | |
} | |
@Inject Event<Configuration> configEvt; | |
public void customConfiguration() { | |
Configuration config = new Configuration(); |
This file contains 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 Event<String> evt; | |
@Inject Event<Message> evtMess; | |
evt.fire("Hello World"); | |
evtMess.fire(new Message("Hello")); | |
public void listenAllStrings(@Observes String evt) { } | |
public void listenAllMessages(@Observes Message message) { } |
This file contains 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
@ApplicationScoped | |
public class TwitterClient implements Serializable { | |
@Inject Twitter twitter; | |
private List<User> users; | |
private List<Status> statuses; | |
private QueryResult search; | |
public void loadTweets() throws TwitterException { | |
statuses = twitter.getFriendsTimeline(); |
This file contains 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
@ApplicationScoped | |
public class AccountService { | |
@Inject @Detected Event<Fraud> event; | |
public void watchActivity(@Observes AccountActivity activity) { | |
Fraud fraud = new Fraud(System.currentTimeMillis()); | |
event.fire(fraud); | |
} | |
} |
This file contains 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 Application extends Controller { | |
public static void index() { | |
List tasks = Task.find("order by id desc").fetch(); | |
render(tasks); | |
} | |
public static void createTask(String title) { | |
Task task = new Task(title).save(); | |
renderJSON(task); |
This file contains 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
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"></link> | |
</head> | |
<body> | |
<a href="#" class="btn success" onclick="openPopup( | |
new Array( | |
{ | |
url:'pop.html?videoId=video1', |
This file contains 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
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css"></link> | |
</head> | |
<body> | |
<a href="#" class="btn success" onclick="openPopup( | |
new Array( | |
{ | |
url:'http://www.google.fr', |