mvn archetype:generate
choose org.apache.camel.archetypes:camel-archetype-java
Done!
11.10.12
10.10.12
Maven + eclipse + WTP
http://www.mkyong.com/maven/how-do-use-maven-to-create-a-dynamic-web-project-in-eclipse/
To put it simple:
mvn archetype:generate
Then select simple-webapp
mvn eclipse:eclipse -Dwtpversion=1.0
Then import into eclipse using "Existing maven project"
To put it simple:
mvn archetype:generate
Then select simple-webapp
mvn eclipse:eclipse -Dwtpversion=1.0
Then import into eclipse using "Existing maven project"
9.10.12
19.9.12
A very simple ZooKeeper Connection Test Program
Just to demonstrate how to use ZooKeeper API in a very simple way. Works as a HelloWorld program.
http://www.slideshare.net/scottleber/apache-zookeeper
Slide 11/76
@Test
public void test() throws Exception {
String hosts = "192.168.119.139:2181";
int sessionTimeout = 100;
final CountDownLatch signal = new CountDownLatch(1);
ZooKeeper zk = new ZooKeeper(hosts, sessionTimeout, new Watcher() {
@Override
public void process(WatchedEvent event) {
if(event.getState() == Watcher.Event.KeeperState.SyncConnected) {
signal.countDown();
}
}
});
signal.await();
zk.close();
}
Just Try ZK's API
From:http://www.slideshare.net/scottleber/apache-zookeeper
Slide 11/76
@Test
public void test() throws Exception {
String hosts = "192.168.119.139:2181";
int sessionTimeout = 100;
final CountDownLatch signal = new CountDownLatch(1);
ZooKeeper zk = new ZooKeeper(hosts, sessionTimeout, new Watcher() {
@Override
public void process(WatchedEvent event) {
if(event.getState() == Watcher.Event.KeeperState.SyncConnected) {
signal.countDown();
}
}
});
signal.await();
zk.close();
}
Another HelloWorld from GitHub
Need to update the following things:
- dependency for zookeeper. GroupID is org.apache.zookeeper now.
- add maven-compiler-plugin if you need it.
FAQ: NumberFormatException?
In a word: don't use "start"
Labels:
ZooKeeper
5.9.12
netstat -plten
that's cool.
You need to run this command using root. Otherwise you will get things like this:
And you can't see the program name/PID column.
You need to run this command using root. Otherwise you will get things like this:
(No info could be read for "-p": geteuid()=21015 but you should be root.)
And you can't see the program name/PID column.
16.3.12
The Boy Scout Rule
http://programmer.97things.oreilly.com/wiki/index.php/The_Boy_Scout_Rule
There are many rules Uncle Bob advocates but don't make sense to me. But this one is absolutely something I will agree.
There are many rules Uncle Bob advocates but don't make sense to me. But this one is absolutely something I will agree.
Subscribe to:
Posts (Atom)