<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-15125903</id><updated>2011-12-04T04:14:59.376+08:00</updated><category term='CXF'/><category term='Document'/><category term='JPA'/><category term='Fedora'/><category term='JBoss'/><category term='OSGi'/><category term='OpenSSO'/><category term='JAVA'/><category term='ODE'/><category term='Subversion'/><category term='RESTEasy'/><category term='REST'/><category term='Postgresql'/><category term='ESB'/><category term='Others'/><category term='jBPM'/><category term='Hibernate'/><category term='Microcontainer'/><category term='WS-CDL'/><category term='Thoughts'/><category term='Chinese'/><category term='XML'/><category term='Security'/><category term='SOA'/><category term='Web Service'/><category term='BPEL'/><category term='OpenSource'/><category term='Mobicents'/><category term='Identity'/><category term='Life'/><category term='Scala'/><category term='Drools'/><category term='Git'/><category term='Database'/><category term='Maven'/><category term='Mac OS'/><category term='Riftsaw'/><category term='BPMN'/><category term='JBossESB'/><category term='JMS'/><category term='Ubuntu'/><category term='Spring'/><category term='Guice'/><title type='text'>Jeff Yu @ IT</title><subtitle type='html'>When you are getting older, your memory becomes worse, so you need to write down some notes from time to time, hence this place was born.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default?start-index=101&amp;max-results=100'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>119</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-15125903.post-7583959372774146394</id><published>2011-08-23T19:13:00.001+08:00</published><updated>2011-08-23T19:13:17.459+08:00</updated><title type='text'>Blog has been moved to http://jeff.familyyu.net</title><content type='html'>Just in case you were wondering you'd happen to see two similar blogs. I've moved the blog into self-hosted space, whose url is: http://jeff.familyyu.net.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7583959372774146394?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7583959372774146394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7583959372774146394'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2011/08/blog-has-been-moved-to.html' title='Blog has been moved to http://jeff.familyyu.net'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5500447831782508804</id><published>2010-09-28T12:03:00.005+08:00</published><updated>2010-09-28T13:30:03.201+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='Riftsaw'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Getting/Using services deployed in JBoss AS 5.x</title><content type='html'>JBoss AS Version 5 and above used the &lt;a href="http://jboss.org/jbossmc"&gt;JBoss MicroContainer&lt;/a&gt; project to accomplish the service management/dependency injection. If we want to write a service that uses a JBoss Server service, like the 'HAPartitionService' for example, the below shows several ways that can be done.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;1. Using JBoss MC's xml syntax&lt;/u&gt;&lt;br /&gt;This is the most common and recommended way to do. Below is the &lt;a href="http://www.jboss.org/riftsaw"&gt;JBoss RiftSaw&lt;/a&gt; Clustering service that uses the 'HAPartitonService' from JBoss AS Cluster.&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;lt;bean name=" riftsawclusteringservice"=""&amp;gt;&lt;br /&gt;      &amp;lt;property name="haPartition"&amp;gt;&amp;lt;inject bean="HAPartition"&amp;gt;&amp;lt;/inject&amp;gt;&amp;lt;/property&amp;gt;&lt;br /&gt;     &amp;lt;property name="bpelEngineName"&amp;gt;bpel/Engine&amp;lt;/property&amp;gt;&lt;br /&gt;     &amp;lt;depends&amp;gt;BPELEngine&amp;lt;/depends&amp;gt;   &lt;br /&gt;&lt;/pre&gt;See Ales' &lt;a href="http://java.dzone.com/articles/a-look-inside-jboss-microconta-0"&gt;Advanced Dependency Injections article&lt;/a&gt; for more about MC's xml syntax.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;2. Using JBoss MC's service programmatically&lt;/u&gt;&lt;br /&gt;This way actually is the main topic for this blog entry. If you are a &lt;a href="http://www.springframework.org"&gt;Spring framework&lt;/a&gt; user, you would know you can use BeanFactory or ApplicationContext to get the service bean. Then in JBoss, you would wonder, whats the equivalent way to do this?&lt;br /&gt;&lt;br /&gt;1) org.jboss.kernel.Kernel, this is the service that has the KernelController and ControllerContext that we need for getting the service. so firstly, you can define a service in -jboss-bean.xml that injects the Kernel service, like the following:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;lt;!--&lt;br /&gt;    Locate the single instance of the kernel&lt;br /&gt;    --&gt;&lt;br /&gt;  &amp;lt;bean name="org.jboss.soa.bpel.runtime.util:service=KernelLocator"&lt;br /&gt;        class="org.jboss.soa.bpel.runtime.integration.KernelLocator"&gt;&lt;br /&gt;    &amp;lt;property name="kernel"&gt;&lt;br /&gt;      &amp;lt;inject bean="jboss.kernel:service=Kernel" /&gt;&lt;br /&gt;    &amp;lt;/property&gt;&lt;br /&gt;  &amp;lt;/bean&gt;&lt;br /&gt;&lt;/pre&gt;We've defined above class as following:&lt;br /&gt;&lt;pre class="brush:java"&gt;package org.jboss.soa.bpel.runtime.integration;&lt;br /&gt;public class KernelLocator&lt;br /&gt;{&lt;br /&gt;  private static Kernel kernel;&lt;br /&gt;&lt;br /&gt;  public static Kernel getKernel()&lt;br /&gt;  {&lt;br /&gt;    return KernelLocator.kernel;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void setKernel(Kernel kernel)&lt;br /&gt;  {&lt;br /&gt;    KernelLocator.kernel = kernel;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2) Use the KernelController and ControllerContext to get the service that we defined in *-jboss-bean.xml. &lt;br /&gt;Below is the code to actually obtain the started service out of JBoss AS.&lt;br /&gt;&lt;pre class="brush:java"&gt;public class KernelAwareSPIFactory&lt;br /&gt;{&lt;br /&gt;   @SuppressWarnings("unchecked")&lt;br /&gt;   public &amp;lt;T&gt; T getKernelProvidedSPI(String beanName, Class&amp;lt;T&gt; spiArtifact)&lt;br /&gt;   {&lt;br /&gt;      KernelController controller = KernelLocator.getKernel().getController();&lt;br /&gt;      ControllerContext ctx = controller.getInstalledContext(beanName);&lt;br /&gt;      return (T)ctx.getTarget();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In the end, let's take an example from &lt;a href="http://jboss.org/riftsaw"&gt;RiftSaw code base&lt;/a&gt; to show how it was used.&lt;br /&gt;&lt;br /&gt;In RiftSaw, we've defined a ServerConfig interface.&lt;br /&gt;&lt;pre class="brush:java"&gt;public interface ServerConfig&lt;br /&gt;{&lt;br /&gt;  /** The default bean name */&lt;br /&gt;  String BEAN_NAME = "org.jboss.soa.bpel.runtime.util:service=ServerConfig";&lt;br /&gt;  &lt;br /&gt;  String getImplementationTitle();&lt;br /&gt;&lt;br /&gt;  String getImplementationVersion();&lt;br /&gt;&lt;br /&gt;  File getServerTempDir();&lt;br /&gt;&lt;br /&gt;  File getServerDataDir();&lt;br /&gt;&lt;br /&gt;  String getWebServiceHost();&lt;br /&gt;&lt;br /&gt;  int getWebServicePort();&lt;br /&gt;&lt;br /&gt;  .....&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And then we've had the ServerConfigImpl class.&lt;br /&gt;&lt;pre class="brush:java"&gt;public class ServerConfigImpl implements ServerConfig&lt;br /&gt;{&lt;br /&gt;  ....&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;With this implementation, we've defined the ServerConfig service in the *-jboss-bean.xml as following.&lt;br /&gt;&lt;pre class="brush:java"&gt;&amp;lt;!--&lt;br /&gt;       ServerConfig&lt;br /&gt;    --&gt;&lt;br /&gt;  &amp;lt;bean name="org.jboss.soa.bpel.runtime.util:service=ServerConfig"&lt;br /&gt;        class="org.jboss.soa.bpel.runtime.integration.ServerConfigImpl"&gt;&lt;br /&gt;    &amp;lt;property name="mbeanServer"&gt;&amp;lt;inject bean="JMXKernel" property="mbeanServer"/&gt;&amp;lt;/property&gt;&lt;br /&gt;    &amp;lt;property name="webServiceHost"&gt;${jboss.bind.address}&amp;lt;/property&gt;&lt;br /&gt;  &amp;lt;/bean&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, finally let's see how we get this ServerConfig Service in our code.&lt;br /&gt;&lt;pre class="brush:java"&gt;ServerConfig = new KernelAwareSPIFactory().getKernelProvidedSPI(&lt;br /&gt;       "org.jboss.soa.bpel.runtime.util:service=ServerConfig", ServerConfig.class&lt;br /&gt;&lt;/pre&gt;And then, here you go, you've got the ServerConfig service that is in the JBoss AS.&lt;br /&gt;&lt;br /&gt;Hope this can help people who are doing integration with JBoss AS a little bit.&lt;br /&gt;&lt;br /&gt;PS: Thanks &lt;a href="http://www.jroller.com/gmazza/"&gt;Glen&lt;/a&gt; for pointing out some grammar errors that I did earlier. As what we used to say "your patch has been applied, thanks a lot. ;)"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5500447831782508804?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5500447831782508804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5500447831782508804'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/09/gettingusing-services-deployed-in-jboss.html' title='Getting/Using services deployed in JBoss AS 5.x'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4857137714824520918</id><published>2010-08-19T09:54:00.000+08:00</published><updated>2010-08-19T09:54:46.217+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Install Mysql and Postgres in Mac OS through MacPorts</title><content type='html'>Here are two greats links on how to installing mysql and postgres on to your Mac OS.&lt;br /&gt;&lt;br /&gt;1.&lt;a href="http://shifteleven.com/articles/2008/03/21/installing-postgresql-on-leopard-using-macports"&gt;Installing PostgreSQL on Leopard using MacPorts&lt;/a&gt;&lt;br /&gt;2.&lt;a href="http://matthewcarriere.com/2008/04/02/installing-mysql-on-mac-os-x-leopard-using-macports/"&gt;Installing MySQL on Mac OS X Leopard using MacPorts&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4857137714824520918?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4857137714824520918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4857137714824520918&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4857137714824520918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4857137714824520918'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/08/install-mysql-and-postgres-in-mac-os.html' title='Install Mysql and Postgres in Mac OS through MacPorts'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-116144034750999348</id><published>2010-07-26T19:18:00.004+08:00</published><updated>2010-07-26T19:31:30.348+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ODE'/><category scheme='http://www.blogger.com/atom/ns#' term='Riftsaw'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Exploring ODE part V: implemenation of scheduler-simple module.</title><content type='html'>In Ode/RiftSaw, we make the process execution as asynchronous, which means that if you running a bpel process, we are using more than one thread to accomplish this invocation.&lt;br /&gt;&lt;br /&gt;And this is what the scheduler-simple module for, it takes care of putting a task into database and pull tasks out of database and how to run them. Lets make a simple example here, say your bpel process has a invoke Activity to invoke an external web service. In Ode, just right before entering invoke Activity, we've created a job that captures this invoke activity information, and store it into the database. Because once we've started Ode Bpel Server, we already started a background thread that checks this ode_job table periodically, once we've found that there is a job needs to be executed, it will load it from database, put it into memory, and then submit it to the ExecutorService for execution.&lt;br /&gt;&lt;br /&gt;In this blogpost, we will examine this module's architecture and important APIs.&lt;br /&gt;&lt;br /&gt;First is the Task API, this is the parent class for Job and SchedulerTask.&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;class Task {&lt;br /&gt;    /** Scheduled date/time. */&lt;br /&gt;    public long schedDate;&lt;br /&gt;&lt;br /&gt;    Task(long schedDate) {&lt;br /&gt;        this.schedDate = schedDate;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It is very simple, just had a scheduled date for its execution.&lt;br /&gt;Next, we will see the Job's API, Job is for invoking an external service and like. we've put all of important information into the JobDetail object.&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;class Job extends Task {&lt;br /&gt;    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");&lt;br /&gt;&lt;br /&gt;    String jobId;&lt;br /&gt;    boolean transacted;&lt;br /&gt;    JobDetails detail;&lt;br /&gt;    boolean persisted = true;&lt;br /&gt;&lt;br /&gt;    public Job(long when, String jobId, boolean transacted, JobDetails jobDetail) {&lt;br /&gt;        super(when);&lt;br /&gt;        this.jobId = jobId;&lt;br /&gt;        this.detail = jobDetail;&lt;br /&gt;        this.transacted = transacted;&lt;br /&gt;    }&lt;br /&gt;....&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, lets look at another type of Task, which is called SchedulerTask.&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;private abstract class SchedulerTask extends Task implements Runnable {&lt;br /&gt;    SchedulerTask(long schedDate) {&lt;br /&gt;        super(schedDate);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is an abstract class, its subclasses are: LoadImmediateTask, UpgradeJobsTask, CheckStaleNodes.&lt;br /&gt;&lt;br /&gt;To understand these tasks, it is better that we look at what SimpleScheduler class defined. In Ode, the job design was based around three time horizons: "immediate", "near future", and "everything else".&lt;br /&gt;Immediate jobs (i.e. jobs that are about to be up) are written to the database and kept in an in-memory priority queue. When they execute, they are removed from the database. Near future jobs are placed in the database and assigned to the current node, however they are not stored in&lt;br /&gt;memory. Periodically jobs are "upgraded" from near-future to immediate status, at which point they get loaded into memory. Jobs that are further out in time, are placed in the database without a node identifer; when they are ready to be "upgraded" to near-future jobs they are assigned to one&lt;br /&gt;of the known live nodes. recovery is straight forward, with stale node identifiers being reassigned to known good nodes.&lt;br /&gt;&lt;br /&gt;In terms of time, we defined two variables, one is: _immediateInterval and _nearFutureInterval.&lt;br /&gt;if a job's scheduled date is between [now, now + _immediateInterval], it belongs to the "immediate" job.&lt;br /&gt;while if it is in [now + _immediateInterval, now + _nearFutureInterval], it belongs to the "near future" job then.&lt;br /&gt;&lt;br /&gt;You can check the SimpleScheduler.doLoadImmediate() and SimpleScheduler.doUpgrade() respectively for its logic.&lt;br /&gt;&lt;br /&gt;Also, you may be aware that we've also had the CheckStaleNodes task, this is basically for clustering work, to&lt;br /&gt;check if there are any stale nodes, if it has, we will move the assigned jobs over to other node by updating nodeId.&lt;br /&gt;&lt;br /&gt;So now, we've seen different Tasks, like Jobs and SchedulerTask. Now, we will need an interface to run these Tasks, hence TaskRunner was introduced.&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;interface TaskRunner {&lt;br /&gt;    public void runTask(Task task);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here is the implementation from SimpleScheduler.TaskRunner() method.&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;public void runTask(final Task task) {&lt;br /&gt;    if (task instanceof Job) {&lt;br /&gt;        Job job = (Job)task;&lt;br /&gt;        if( job.detail.getDetailsExt().get("runnable") != null ) {&lt;br /&gt;            runPolledRunnable(job);&lt;br /&gt;        } else {&lt;br /&gt;            runJob(job);&lt;br /&gt;        }&lt;br /&gt;    } else if (task instanceof SchedulerTask) {&lt;br /&gt;        _exec.submit(new Callable&lt;void&gt;() {&lt;br /&gt;            public Void call() throws Exception {&lt;br /&gt;                try {&lt;br /&gt;                    ((SchedulerTask) task).run();&lt;br /&gt;                } catch (Exception ex) {&lt;br /&gt;                    __log.error("Error during SchedulerTask execution", ex);&lt;br /&gt;                }&lt;br /&gt;                return null;&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As I said before, once we've start BpelServer, we will start a thread running, it only gets stopped only when the BpelServer is been stopped.&lt;br /&gt;Thats called SchedulerThread.&lt;br /&gt;&lt;br /&gt;In this class, basically we had following members: PriorityBlockingQueue&lt;task&gt;, this is queue for the immediate execution. TaskRunner, this is the&lt;br /&gt;container for running Task. The logic for the running is quite straight forward.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;/**&lt;br /&gt; * Pop items off the todo queue, and send them to the task runner for processing.&lt;br /&gt; */&lt;br /&gt;public void run() {&lt;br /&gt;    while (!_done) {&lt;br /&gt;        _lock.lock();&lt;br /&gt;        try {&lt;br /&gt;            long nextjob;&lt;br /&gt;            while ((nextjob = nextJobTime()) &gt; 0 &amp;amp;&amp;amp; !_done)&lt;br /&gt;                _activity.await(nextjob, TimeUnit.MILLISECONDS);&lt;br /&gt;&lt;br /&gt;            if (!_done &amp;amp;&amp;amp; nextjob == 0) {&lt;br /&gt;                Task task = _todo.take();&lt;br /&gt;                _taskrunner.runTask(task);&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;        } catch (InterruptedException ex) {&lt;br /&gt;            ; // ignore&lt;br /&gt;        } finally {&lt;br /&gt;            _lock.unlock();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now that we've seen all of important APIs here, we will look at how we start SimpleScheduler when ODEServer is started.&lt;br /&gt;excerpt from SimpleScheduler.start() method.&lt;br /&gt;&lt;br /&gt;public synchronized void start() {&lt;br /&gt;    if (_running)&lt;br /&gt;        return;&lt;br /&gt;&lt;br /&gt;    if (_exec == null)&lt;br /&gt;        _exec = Executors.newCachedThreadPool();&lt;br /&gt;&lt;br /&gt;    _todo.clearTasks(UpgradeJobsTask.class);&lt;br /&gt;    _todo.clearTasks(LoadImmediateTask.class);&lt;br /&gt;    _todo.clearTasks(CheckStaleNodes.class);&lt;br /&gt;    _processedSinceLastLoadTask.clear();&lt;br /&gt;    _outstandingJobs.clear();&lt;br /&gt;&lt;br /&gt;    _knownNodes.clear();&lt;br /&gt;&lt;br /&gt;    try {&lt;br /&gt;        execTransaction(new Callable&lt;void&gt;() {&lt;br /&gt;&lt;br /&gt;            public Void call() throws Exception {&lt;br /&gt;                _knownNodes.addAll(_db.getNodeIds());&lt;br /&gt;                return null;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;        });&lt;br /&gt;    } catch (Exception ex) {&lt;br /&gt;        __log.error("Error retrieving node list.", ex);&lt;br /&gt;        throw new ContextException("Error retrieving node list.", ex);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    long now = System.currentTimeMillis();&lt;br /&gt;&lt;br /&gt;    // Pretend we got a heartbeat...&lt;br /&gt;    for (String s : _knownNodes) _lastHeartBeat.put(s, now);&lt;br /&gt;&lt;br /&gt;    // schedule immediate job loading for now!&lt;br /&gt;    _todo.enqueue(new LoadImmediateTask(now));&lt;br /&gt;&lt;br /&gt;    // schedule check for stale nodes, make it random so that the nodes don't overlap.&lt;br /&gt;    _todo.enqueue(new CheckStaleNodes(now + randomMean(_staleInterval)));&lt;br /&gt;&lt;br /&gt;    // do the upgrade sometime (random) in the immediate interval.&lt;br /&gt;    _todo.enqueue(new UpgradeJobsTask(now + randomMean(_immediateInterval)));&lt;br /&gt;&lt;br /&gt;    _todo.start();&lt;br /&gt;    _running = true;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also, please noted that we had two different types of JobProcessor, one is ordinary JobProcessor, the other one is PolledRunnableJobProcessor, which is meant for running some jobs that gets run periodically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-116144034750999348?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/116144034750999348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=116144034750999348&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/116144034750999348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/116144034750999348'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/07/exploring-ode-part-v-implemenation-of.html' title='Exploring ODE part V: implemenation of scheduler-simple module.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7463609398369384382</id><published>2010-07-23T07:51:00.008+08:00</published><updated>2010-07-23T08:57:37.117+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS'/><title type='text'>My Roadmap on Mac OS X</title><content type='html'>Just like what I did for &lt;a href="http://jeff.familyyu.net/2008/05/my-fedora8-roadmap-on-t61p.html"&gt;my fedora roadmap&lt;/a&gt;, here comes my Mac OS X one.&lt;br /&gt;&lt;br /&gt;1. Instant message: Adium, &lt;a href="http://adium.im/"&gt;http://adium.im/&lt;/a&gt;&lt;br /&gt;2. video chat: skype, &lt;a href="http://www.skype.com/"&gt;http://www.skype.com&lt;/a&gt;&lt;br /&gt;3. irc client, colloquy, &lt;a href="http://colloquy.info/"&gt;http://colloquy.info/&lt;/a&gt;&lt;br /&gt;4. chinese input, just use the built-in one directly, here is an post about the chinese input, and also can use the chinese language for the whole mac osx. &lt;a href="http://appleclinic.wordpress.com/2008/04/16/chinese-text-input/"&gt;http://appleclinic.wordpress.com/2008/04/16/chinese-text-input/&lt;/a&gt;&lt;br /&gt;5. firefox, In case you still like to use the firefox in your mac box, yes, it works great. &lt;a href="http://www.firefox.com/"&gt;http://www.firefox.com&lt;/a&gt;&lt;br /&gt;6. twitter client, twitterrific: &lt;a href="http://iconfactory.com/software/twitterrific"&gt;http://iconfactory.com/software/twitterrific&lt;/a&gt;&lt;br /&gt;7. QQ, this one should be very china specific, :), good news is that we do have a &lt;a href="http://im.qq.com/qq/mac/download.shtml"&gt;Mac OS X QQ&lt;/a&gt; as beta right now.&lt;br /&gt;8. QuickSilver, this is a new tool compared to what I had in both windows and linux, it makes people really easy to start application, you can download and install it from here. &lt;a href="http://www.blacktree.com/"&gt;http://www.blacktree.com/&lt;/a&gt;&lt;br /&gt;9. Textmate, this one is a lot of rubyists choice on doing ruby on rails.. &lt;a href="http://macromates.com/"&gt;http://macromates.com/&lt;/a&gt;, not free though.&lt;br /&gt;10. Skitch, &lt;a href="http://skitch.com/"&gt;http://skitch.com/&lt;/a&gt;, make it easy to share screenshot etc.&lt;br /&gt;11. &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;, this is still my preference for java programming.&lt;br /&gt;12. &lt;a href="http://www.macports.org/install.php"&gt;Macports&lt;/a&gt;, this is a utility more like Fedora's Yum, Ubuntu's apt-get.&lt;br /&gt;13. &lt;a href="http://growl.info/"&gt;Growl&lt;/a&gt;, this is a great software for the notifications.&lt;br /&gt;14. &lt;a href="http://growl.info/"&gt;dropbox&lt;/a&gt;, this is a pretty good software if you want to sync stuff between mac and iphone.&lt;br /&gt;&lt;br /&gt;If you want to install JDK5 in the snow leopard, here is a good solution to this problem, &lt;a href="http://www.scribd.com/doc/22853741/Installing-Java-5-Back-on-Snow-Leopard"&gt;http://www.scribd.com/doc/22853741/Installing-Java-5-Back-on-Snow-Leopard&lt;/a&gt;, Here I'd like to thank &lt;a href="http://kurtstam.blogspot.com/"&gt;Kurt&lt;/a&gt;, strong, liweinan for making some suggestions on these softwares. ;)&lt;br /&gt;&lt;br /&gt;At last, this is what I had, &lt;a href="http://skitch.com/jeffyu/dp3pm/fullscreen"&gt;http://skitch.com/jeffyu/dp3pm/fullscreen&lt;/a&gt;. ;)&lt;br /&gt;&lt;br /&gt;please let me know what else you believe that I should try out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7463609398369384382?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7463609398369384382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7463609398369384382&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7463609398369384382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7463609398369384382'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/07/my-roadmap-on-mac-os-x.html' title='My Roadmap on Mac OS X'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-394947106435356473</id><published>2010-02-20T23:22:00.009+08:00</published><updated>2010-02-21T23:56:06.067+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ODE'/><category scheme='http://www.blogger.com/atom/ns#' term='Riftsaw'/><title type='text'>Exploring ODE Part IV: BpelServer API</title><content type='html'>If you look at the ODE source code, the BpelServer API is a very important one. In this entry, we will look at the class that how we use the BpelServer, for the ODE, lets look at the &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java"&gt;ODEServer&lt;/a&gt; source code. &lt;pre class="brush:java"&gt;&lt;br /&gt;       __log.debug("Initializing transaction manager");&lt;br /&gt;        initTxMgr();&lt;br /&gt;        __log.debug("Creating data source.");&lt;br /&gt;        initDataSource();&lt;br /&gt;        __log.debug("Starting DAO.");&lt;br /&gt;        initDAO();&lt;br /&gt;        EndpointReferenceContextImpl eprContext = new EndpointReferenceContextImpl(this);        &lt;br /&gt;        __log.debug("Initializing BPEL process store.");&lt;br /&gt;        initProcessStore(eprContext);&lt;br /&gt;        __log.debug("Initializing BPEL server.");&lt;br /&gt;        initBpelServer(eprContext);&lt;br /&gt;        __log.debug("Initializing HTTP connection manager");&lt;br /&gt;        initHttpConnectionManager();&lt;br /&gt;&lt;br /&gt;        // Register BPEL event listeners configured in axis2.properties file.&lt;br /&gt;        registerEventListeners();&lt;br /&gt;        registerMexInterceptors();&lt;br /&gt;        registerContextInterceptors();&lt;br /&gt;        .....&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As above code shown:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Initialized the TransactionManager, which will be used in the datasource and scheduler service. &lt;/li&gt;&lt;li&gt;Created the data source.&lt;/li&gt;&lt;li&gt;Created the DAOConnectionFactory, the extension API is BpelDAOConnectionFactory.&lt;/li&gt;&lt;li&gt;Created the EndpointReferenceContext, which takes care of resolving EndpointReference.&lt;/li&gt;&lt;li&gt;Created the Process Store, it takes care of process deploying, undeploying, list etc.&lt;/li&gt;&lt;li&gt;Initializing the BpelServer, includes following actions: setMessageExchangeContext, setDaoConnectionFactory, setBindingContext, the BindingContext and the MessageExchangeContext are the extension points for communicating with partner services.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Register the EventListners, MexInterceptors etc, these are all the APIs in BpelServer.&lt;/li&gt;&lt;/ul&gt;You also could see how we initialize the BpelServer in the &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/engine/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java"&gt;MockBpelServer&lt;/a&gt; class. In the &lt;a href="http://www.jboss.org/riftsaw"&gt;Riftsaw project&lt;/a&gt;,it is in the &lt;a href="http://anonsvn.jboss.org/repos/riftsaw/trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java"&gt;BpelEngineImpl&lt;/a&gt; class. In the Riftsaw project, we are adding another implementation for the ProcessStore that leverages the JBoss Application Server's Deployer mechanism, also we adding another implementation for the BindingContext that use the JAXWS based approach, which used the JBossWS to accomplish.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-394947106435356473?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/394947106435356473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=394947106435356473&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/394947106435356473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/394947106435356473'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/02/exploring-ode-part-iv-bpelserver.html' title='Exploring ODE Part IV: BpelServer API'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3900653942315283436</id><published>2010-02-20T12:16:00.006+08:00</published><updated>2010-02-20T21:59:40.422+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CXF'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><title type='text'>Apache CXF Web Service Development book.</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.packtpub.com/apache-cxf-web-service-development/book"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 100px; height: 123px;" src="http://1.bp.blogspot.com/_4KnaH_XIr1w/S39lQ7I8BxI/AAAAAAAACSk/fw76wxZFwuw/s400/cxf-ws-dev.png" alt="" id="BLOGGER_PHOTO_ID_5440178216314341138" border="0" /&gt;&lt;/a&gt;I was invited to review the new book about &lt;a href="http://cxf.apache.org/"&gt;Apache CXF&lt;/a&gt; from packtpub, it is called《&lt;a href="http://www.packtpub.com/apache-cxf-web-service-development/book"&gt;Apache CXF Web Service Development&lt;/a&gt;》by &lt;a href="http://www.packtpub.com/author_view_profile/id/410" title="Naveen Balani"&gt;Naveen Balani&lt;/a&gt; and                     &lt;a href="http://www.packtpub.com/author_view_profile/id/411" title="Rajeev Hathi"&gt;Rajeev Hathi&lt;/a&gt;. From the table of content, it covers both web service and restful service in CXF, also had three chapters for the CXF's frontend, transport, interceptors, invoke etc, which are the essential concepts of CXF's architecture. So it definitely seems interesting to me. I will post more detailed review once I finished the book.&lt;br /&gt;&lt;div&gt;                    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3900653942315283436?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3900653942315283436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3900653942315283436&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3900653942315283436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3900653942315283436'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/02/apache-cxf-web-service-development-book.html' title='Apache CXF Web Service Development book.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_4KnaH_XIr1w/S39lQ7I8BxI/AAAAAAAACSk/fw76wxZFwuw/s72-c/cxf-ws-dev.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2131173250257739620</id><published>2010-01-29T22:16:00.015+08:00</published><updated>2010-02-01T11:33:31.282+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ODE'/><category scheme='http://www.blogger.com/atom/ns#' term='BPEL'/><category scheme='http://www.blogger.com/atom/ns#' term='Riftsaw'/><title type='text'>Exploring ODE Part III: architecture and modules introduction</title><content type='html'>In this blog entry, we will continue to explore the ODE source code. Typically, we should see the ODE's architecture in our first part of this series, but here I put it in the third part, as at that time, I was just trying to write a blog entry about the ODE's inner model about bpel file, didn't thought I will write this as a series.&lt;br /&gt;&lt;br /&gt;Anyway, lets see the ODE's architecture diagram, which I copied it from the &lt;a href="http://ode.apache.org/architectural-overview.html"&gt;ODE's architecture wiki page&lt;/a&gt;.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4KnaH_XIr1w/S2Lwy2yg3UI/AAAAAAAACSc/VYFVYne7cS4/s1600-h/OdeArchitecture.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 266px;" src="http://4.bp.blogspot.com/_4KnaH_XIr1w/S2Lwy2yg3UI/AAAAAAAACSc/VYFVYne7cS4/s400/OdeArchitecture.png" alt="" id="BLOGGER_PHOTO_ID_5432168857053748546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;On &lt;a href="http://jeff.familyyu.net/2010/01/exploring-apache-ode-source-code-part-i.html"&gt;our first part&lt;/a&gt;, we look at the bpel compiler module, and we look at the JACOB framework on &lt;a href="http://jeff.familyyu.net/2010/01/exploring-apache-ode-source-code-part.html"&gt;our second part&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In this part, we will try to make an introduction to ODE's modules:&lt;br /&gt;&lt;br /&gt;&lt;u&gt; ODE core modules&lt;/u&gt;&lt;br /&gt;1.bpel-api: It contains the api definition for ODE, some important packages are: &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;org.apache.ode.bpel.iapi: this is for integration interfaces, like Axis2 module will implement it.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;org.apache.ode.bpel.rapi: these interfaces are for runtime api that are implemented in the bpel-runtime module. &lt;/li&gt;&lt;li&gt;org.apache.ode.bpel.pmapi: this is for the process management. &lt;/li&gt;&lt;li&gt;org.apache.ode.bpel.evt: this is for the event.&lt;/li&gt;&lt;/ul&gt;2. bpel-runtimes: this module takes care of implementing the Bpel's Activities, like INVOKE, REPLY, WAIT by extending the JacobRunnable Object, also it is the place that includes the internal model for compiled Bpel file, and Channel definition. You would notice that it has v1 and v2 packages, thats for ODE 1.x and ODE 2.x respectively.&lt;br /&gt;3. bpel-dao: this module is the API for DAO layer, currently, it doesn't include the DAO API for process store.&lt;br /&gt;4. dao-jpa: currently it is the openjpa implementation for DAO.&lt;br /&gt;5. dao-jpa-db: This is the DDL script for openjpa's impl.&lt;br /&gt;6. dao-hibernate, dao-hibernate-db: these two are the Hibernate's impl for DAO, and its DDL scripts.&lt;br /&gt;7. bpel-schemas: this is module that use xmlbeans to generate Java objects from xsd schemas, they are: deploymentDescriptor, (dd.xsd), pmapi.xsd (Process Management API), schedules.xsd, context.xsd.&lt;br /&gt;8. bpel-scripts: this module is having those bpel files, it is used in bpel-compiler's test case.&lt;br /&gt;9. bpel-compiler: this module is to convert the bpel file into ODE internal model for compiled bpel file.&lt;br /&gt;10. il-common: this module is the common integration layer.&lt;br /&gt;11. scheduler-simple: this module is the implementation of scheduler service.&lt;br /&gt;12. bpel-store: this is the module takes charge of storing process from the filesystem, the artifact includes deploy.xml, .bpel, wsdl artifacts.&lt;br /&gt;13. engine: this is the ode engine that uses the runtimes, dao, scheduler services.&lt;br /&gt;14. bpel-ql: bpel query language.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;JACOB framework module&lt;/u&gt;&lt;br /&gt;1. jacob-ap&lt;br /&gt;2. jacob&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Integration modules:&lt;/u&gt;&lt;br /&gt;1.&lt;u&gt;axis2 integration:&lt;/u&gt; axis2, axis2-war&lt;br /&gt;2.&lt;u&gt;jca integration:&lt;/u&gt; bpel-api-jca, bpel-connector, jca-ra, jca-server&lt;br /&gt;3.&lt;u&gt;jbi integration:&lt;/u&gt; jbi&lt;br /&gt;4.&lt;u&gt;extension:&lt;/u&gt; extensions&lt;br /&gt;&lt;br /&gt;&lt;u&gt;some leftover modules are:&lt;/u&gt;&lt;br /&gt;1. tools: this is for the bpelc, sendsoap command line.&lt;br /&gt;2. utils: utils for ODE project.&lt;br /&gt;3. tasks: this is tasks for buildr tool.&lt;br /&gt;4. distro: this is the module for building distro.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2131173250257739620?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2131173250257739620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2131173250257739620&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2131173250257739620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2131173250257739620'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/01/exploring-apache-ode-source-code-part_29.html' title='Exploring ODE Part III: architecture and modules introduction'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_4KnaH_XIr1w/S2Lwy2yg3UI/AAAAAAAACSc/VYFVYne7cS4/s72-c/OdeArchitecture.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7615991349976091335</id><published>2010-01-27T15:50:00.021+08:00</published><updated>2010-01-31T21:19:56.449+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ODE'/><category scheme='http://www.blogger.com/atom/ns#' term='BPEL'/><category scheme='http://www.blogger.com/atom/ns#' term='Riftsaw'/><title type='text'>Exploring ODE Part II: JACOB Framework</title><content type='html'>In this blog entry, we will look at the ODE's jacob framework, which is of a library taking care of concurrency processing. ODE use this lib underlying to solve the concurrency problem, ODE has &lt;a href="http://ode.apache.org/jacob.html"&gt;a very good wiki&lt;/a&gt; explains about this framework, but here I would like to highlight some concepts and introduce a simple example in the end.&lt;br /&gt;&lt;br /&gt;Firstly, I am reusing the wiki page's example. Say we have a following process.&lt;br /&gt;&lt;pre class="brush:xml"&gt;1.invoke&lt;br /&gt;2.receive&lt;br /&gt;3.wait&lt;br /&gt;4.invoke&lt;br /&gt;&lt;/pre&gt;and we have 2 parallel execution of the process, without Jacob framework the execution would be:&lt;br /&gt;&lt;pre class="brush:xml"&gt;1. Invoke1&lt;br /&gt;2. Receive1&lt;br /&gt;3. Wait1&lt;br /&gt;4. Invoke1&lt;br /&gt;5. Invoke2&lt;br /&gt;6. Receive2&lt;br /&gt;7. Wait2&lt;br /&gt;8. Invoke2&lt;br /&gt;&lt;/pre&gt;so the above is totally sequentially, no concurrency at all. With the jacob framework, we might see following execution order.&lt;br /&gt;&lt;pre class="brush:xml"&gt;1. Invoke1&lt;br /&gt;5. Invoke2&lt;br /&gt;2. Receive1&lt;br /&gt;3. Wait1&lt;br /&gt;6. Receive2&lt;br /&gt;7. Wait2&lt;br /&gt;4. Invoke1&lt;br /&gt;8. Invoke2&lt;br /&gt;&lt;/pre&gt;From a client standpoint, we've achieved concurrency of execution even with one thread.&lt;br /&gt;&lt;br /&gt;Now, we will see following concepts in jacob:&lt;br /&gt;&lt;br /&gt;1. &lt;u&gt;JacobRunnable, JacobObject&lt;/u&gt;&lt;br /&gt;In the wiki page, the JacobRunnable, JacobObject is described as a simple closure. Just like above example shows, here we abstract the action like 'Invoke, Receive' etc as a JacobRunnable object. Personally I also see JacobRunnable as a command pattern, which implements the run method.&lt;br /&gt;&lt;br /&gt;2. &lt;u&gt;Channel&lt;/u&gt;&lt;br /&gt;Once we have had the JacobRunnable object, how do we connect two JacobRunnable objects? in other words, how do we invoke the wait activity after the invoke in our above example. Here is where Channel comes to play, its function is to build connections between JacobRunnable. The Channel implementation is used JDK's dynamic proxy, you can see it from &lt;b&gt;ChannelFactory&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;3. &lt;u&gt;ChannelListener&lt;/u&gt;&lt;br /&gt;In the wiki page, it is referred as MLs (MethodList), but I'd prefer to call it as Listener. With introduction of &lt;span style="font-weight: bold;"&gt;Channel&lt;/span&gt; object, we are able to pass the Channel object into our next activity or child activity, but we need to have a listener mechanism for the parent activity so that once the child activity finished, it is able to get notified and continues the flow.&lt;br /&gt;&lt;br /&gt;4. &lt;u&gt;@ChannelType annotion&lt;/u&gt;&lt;br /&gt;In the Jacob, we are using the '@ChannelType' annotation to generate the Channel and ChannelListener interfaces in the compile time.&lt;br /&gt;&lt;br /&gt;5. &lt;u&gt;JacobVPU, ExecutionQueueImpl&lt;/u&gt;&lt;br /&gt;As wiki page said, here are the responsibilities of JacboVPU and ExecutionQueueImpl.&lt;br /&gt;1) JacobVPU is the place of Jacob processing.&lt;br /&gt;2) ExecutionQueueImpl is the container for all artifacts (mostly channels and reactions) managed by JacobVPU.&lt;br /&gt;3) JacobVPU is also responsible for persisting its internal state, like serialize or de-serialize the object.&lt;br /&gt;4) Continuations (and hence JacobRunnables) don't "stay" in the VPU queues. They just get popped, executed and that's it.&lt;br /&gt;&lt;br /&gt;Now, I will introduce an example that works with Jacob API to accomplish the above example. we are having three JacobObjects(Continuation), they are INVOKE, RECEIVE, WAIT. But for the simplicity purpose, I will just have INVOKE and RECEIVE. Also we will add a channel for their communication, I called it Demo, here is the code for Demo Channel.&lt;br /&gt;&lt;pre class="brush:java"&gt;@ChannelType&lt;br /&gt;public interface Demo {&lt;br /&gt;public void onSuccess(String successInfo);&lt;br /&gt;public void onFailure(String errorString);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;as you read from the code, we are having two methods, one for successful case, the other is for failure. use either the maven tool or buildr, you would see the generated classes for this interface, they are DemoChannel and DemoChannelListener.&lt;br /&gt;&lt;br /&gt;Next, we will see actions.&lt;br /&gt;&lt;pre class="brush:java"&gt;static class INVOKE extends JacobRunnable {&lt;br /&gt;private DemoChannel _channel;&lt;br /&gt;&lt;br /&gt;public INVOKE(DemoChannel channel) {&lt;br /&gt;_channel = channel;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public void run() {&lt;br /&gt;System.out.println("INVOKE Activity");&lt;br /&gt;&lt;br /&gt;DemoChannel demoChannel2 = newChannel(DemoChannel.class, "demo2");&lt;br /&gt;instance(new RECIEVE(demoChannel2));&lt;br /&gt;object(new DemoChannelListener(demoChannel2) {&lt;br /&gt;public void onSuccess(String successInfo) {&lt;br /&gt; System.out.println(successInfo);&lt;br /&gt; _channel.onSuccess("INVOKE Done...");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void onFailure(String errorString) {&lt;br /&gt; System.out.println(errorString); &lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static class RECIEVE extends JacobRunnable {&lt;br /&gt;private DemoChannel _demoChannel;&lt;br /&gt;&lt;br /&gt;public RECIEVE(DemoChannel demoChannel) {&lt;br /&gt;_demoChannel = demoChannel;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public void run() {&lt;br /&gt;System.out.println("Receive Activity");&lt;br /&gt;_demoChannel.onSuccess("RECEIVE success...");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;For this example, I will add another action to start our process, it is called Process.&lt;br /&gt;&lt;pre class="brush:xml"&gt;static class Process extends JacobRunnable {&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public void run() {&lt;br /&gt;DemoChannel channel = newChannel(DemoChannel.class, "demo");&lt;br /&gt;instance(new INVOKE(channel));&lt;br /&gt;object(new DemoChannelListener(channel) {&lt;br /&gt;public void onSuccess(String successInfo) {&lt;br /&gt; System.out.println(successInfo);&lt;br /&gt; System.out.println("Process Done");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void onFailure(String errorString) {&lt;br /&gt; System.out.println(errorString); &lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;We will talk from Process class, basically, we've created a DemoChannel, and then we use 'instance(...)' method to add the 'activity/JacobRunnable' into the queue, use the 'object(....)' to define a listener for that channel.&lt;br /&gt;In the INVOKE class, we've created a child activity that is called RECEIVE. Which puts RECEIVE class as part of INVOKE class. I know this is a bad example, it would be much better if I use a composite activity, like While or Sequence, but you know I am just being lazy. ;)&lt;br /&gt;&lt;br /&gt;At last, we will use following code to execute this example:&lt;pre class="brush:java"&gt;public static void main(String[] args) throws Exception {&lt;br /&gt;ExecutionQueueImpl soup = new ExecutionQueueImpl(null);&lt;br /&gt;JacobVPU vpu = new JacobVPU(soup, new Process());&lt;br /&gt;&lt;br /&gt;while(vpu.execute()) {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Run this method, you would get following output.&lt;br /&gt;&lt;pre class="brush:xml"&gt;INVOKE Activity&lt;br /&gt;Receive Activity&lt;br /&gt;RECEIVE success...&lt;br /&gt;INVOKE Done...&lt;br /&gt;Process Done&lt;br /&gt;&lt;/pre&gt;If you want to look at the code by yourself, it lies in the &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/jacob/"&gt;ode-jacob&lt;/a&gt; module, it extends the &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/jacob-ap/"&gt;ode-jacob-ap&lt;/a&gt; module. Below are some classes that you'd look into. &lt;span style="font-weight: bold;"&gt;CommSend&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;CommRecv&lt;/span&gt;. Jacob wraps the JacobRunnable as CommSend, wraps the ChannelListener as CommRecv. And then uses the &lt;span style="font-weight: bold;"&gt;CommGroup&lt;/span&gt; to do the match.&lt;span style="font-weight: bold;"&gt;ExecutionQueueImpl&lt;/span&gt; is the container for &lt;span style="font-weight: bold;"&gt;Continuation&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;ExecutionObject&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;Channel&lt;/span&gt; etc. In the ExecutionQueueImpl class, you would find couple static classes, like ChannelFrame, MessageFrame... these classes are mostly used for serialized and de-serialized the object.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7615991349976091335?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7615991349976091335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7615991349976091335&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7615991349976091335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7615991349976091335'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/01/exploring-apache-ode-source-code-part.html' title='Exploring ODE Part II: JACOB Framework'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6903238706216395634</id><published>2010-01-26T18:32:00.019+08:00</published><updated>2010-01-31T21:19:33.247+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ODE'/><category scheme='http://www.blogger.com/atom/ns#' term='BPEL'/><category scheme='http://www.blogger.com/atom/ns#' term='Riftsaw'/><title type='text'>Exploring ODE Part I: Bpel Compiler and its internal model.</title><content type='html'>In the &lt;a href="http://ode.apache.org/"&gt;Apache ODE&lt;/a&gt;, it has a bpelc, bpelc.bat script for you to compile the bpel file into ODE specific format file. We can use this tool to verify whether the bpel file's semantic is correct or not.&lt;br /&gt;&lt;br /&gt;So in this blog entry, we will take a closer look at the architecture of this tool, (also known as &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/bpel-compiler/"&gt;bpel-compiler&lt;/a&gt; module). The &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/tools/"&gt;ode-tool&lt;/a&gt; module is just a wrapper for &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/bpel-compiler/"&gt;bpel-compiler&lt;/a&gt; module.&lt;br /&gt;&lt;br /&gt;Firstly, lets look at the bpel object model for BPEL file, it is known as 'bom' (bpel object model, I guess) in the source file. It put all of bpel object model into this package, and its base class is &lt;span style="font-weight: bold;"&gt;BpelObject&lt;/span&gt;, this base class extends the &lt;span style="font-weight: bold;"&gt;sourceLocation&lt;/span&gt; which is for keeping detail info of original bpel file. some known subclasses are: IfActivity, PartnerLink, PartnerLinkType, SequenceActivity etc. These subclasses share one feature, their constructor parameter type is Element.&lt;br /&gt;&lt;br /&gt;Second concept here is called &lt;span style="font-weight: bold;"&gt;ActivityGenerator&lt;/span&gt;, as name implied, it is taking care of generating the Activities, like IfActivity, InvokeActivity, SequenceActivity.&lt;br /&gt;&lt;br /&gt;The other concept is called &lt;span style="font-weight: bold;"&gt;OBase&lt;/span&gt;, this class is a base class for compiled bpel object, the known subclasses are: OAssign, OInvoke, which both extend from &lt;span style="font-weight: bold;"&gt;OActivity&lt;/span&gt;, others are like: OPartnerlink, OProperty..&lt;br /&gt;&lt;br /&gt;So in the bpel-compiler module, the work procedure is convert the bpel file into BOM, and then using AcitivityGenerator to convert them into OBase (ODE inner Object model).&lt;br /&gt;&lt;br /&gt;If you want to look at the source code, you can start with &lt;span style="font-weight: bold;"&gt;BpelC&lt;/span&gt; class, the method for it is called compile(File file), in this method, you would find it uses the &lt;span style="font-weight: bold;"&gt;BpelObjectFactory&lt;/span&gt; to convert the xml file into BOM, and then get the correct &lt;span style="font-weight: bold;"&gt;BpelCompiler&lt;/span&gt; implementation to convert the BOM object to compiled object representation. (objects extends OBase class).&lt;br /&gt;&lt;br /&gt;In the bpel-compiler module's test part, we are using the bpel files that are put in the &lt;a href="http://svn.apache.org/repos/asf/ode/trunk/bpel-scripts/"&gt;bpel-scripts&lt;/a&gt; module, to do the unit test. If you want to learn about the bpel's activity, this is also a good resource.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6903238706216395634?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6903238706216395634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6903238706216395634&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6903238706216395634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6903238706216395634'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/01/exploring-apache-ode-source-code-part-i.html' title='Exploring ODE Part I: Bpel Compiler and its internal model.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6974201377384010075</id><published>2010-01-22T16:39:00.004+08:00</published><updated>2010-01-22T17:43:43.850+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Maven Global Excludes tip.</title><content type='html'>If you work on a project that has ton of jar dependencies, and you want to exclude the 'xerces' (for example), you might end up using the exclusion multiple times, as a lot of jars are depending on the 'xerces'. In this case, you can use &lt;a href="http://jlorenzen.blogspot.com/2009/06/maven-global-excludes.html"&gt;following way to achieve the 'global exclude' &lt;/a&gt;in maven.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6974201377384010075?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6974201377384010075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6974201377384010075&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6974201377384010075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6974201377384010075'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/01/maven-global-excludes-tip.html' title='Maven Global Excludes tip.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4591717495078399823</id><published>2010-01-19T14:12:00.004+08:00</published><updated>2010-01-19T14:24:06.146+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Connecting to various DBs by using ant's sql command.</title><content type='html'>As you see from &lt;a href="http://jeff.familyyu.net/2010/01/using-oracle-instant-and-sqlplus-in.html"&gt;my previous blog&lt;/a&gt;, I set up oracle client to connect to the remote DB server to do the debug. If you just deal with one DB server, this should be fine, what if you need to test against various DB servers, like mysql, postgres, oracle and sqlserver, which is &lt;a href="http://jboss.org/riftsaw"&gt;our riftsaw project&lt;/a&gt; need to be tested against, so instead of installing all of these clients, I am using the &lt;a href="http://ant.apache.org/manual/"&gt;Apache Ant's sql command&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I added a command to show all of tables in the db, below is the build.xml that I used. &lt;pre class="brush:xml"&gt;&lt;br /&gt; &amp;lt;target name="db.show.tables"&lt;br /&gt;             depends="log.properties, copy.ojdbc"&lt;br /&gt;             description="show tables in db"&gt;&lt;br /&gt;   &amp;lt;sql driver="${driver}"&lt;br /&gt;        url="${connection.url}"&lt;br /&gt;        userid="${username}"&lt;br /&gt;        password="${password}"&lt;br /&gt;        onerror="continue"&lt;br /&gt;        print="true"&gt;&lt;br /&gt;     ${show.table.sql}&lt;br /&gt;     &amp;lt;classpath&gt;&lt;br /&gt;       &amp;lt;fileset dir="drivers"&gt;&lt;br /&gt;           &amp;lt;include name="*.jar"/&gt;&lt;br /&gt;       &amp;lt;/fileset&gt;&lt;br /&gt;     &amp;lt;/classpath&gt;&lt;br /&gt;   &amp;lt;/sql&gt;&lt;br /&gt;   &amp;lt;/target&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Different database vendor has its own syntax for showing tables, as I defined below.&lt;pre class="brush:xml"&gt;&lt;br /&gt; &amp;lt;condition property="show.table.sql" value="show tables;"&gt;&lt;br /&gt;       &amp;lt;equals arg1="${database}" arg2="mysql" /&gt;&lt;br /&gt; &amp;lt;/condition&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;condition property="show.table.sql" value="select table_name from information_schema.tables where table_schema='public' and table_type='BASE TABLE';"&gt;&lt;br /&gt;       &amp;lt;equals arg1="${database}" arg2="postgres" /&gt;&lt;br /&gt; &amp;lt;/condition&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;condition property="show.table.sql" value="select table_name from tabs;"&gt;&lt;br /&gt;       &amp;lt;equals arg1="${database}" arg2="oracle" /&gt;&lt;br /&gt; &amp;lt;/condition&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;condition property="show.table.sql" value="select name from riftsaw..sysobjects where xtype = 'U';"&gt;&lt;br /&gt;       &amp;lt;equals arg1="${database}" arg2="sqlserver" /&gt;&lt;br /&gt; &amp;lt;/condition&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;By using this approach, you don't need to install those db clients, which could save you a lot of time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4591717495078399823?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4591717495078399823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4591717495078399823&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4591717495078399823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4591717495078399823'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/01/connecting-to-various-dbs-by-using-ants.html' title='Connecting to various DBs by using ant&apos;s sql command.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7181177899397202577</id><published>2010-01-15T19:02:00.004+08:00</published><updated>2010-01-15T19:09:14.764+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Using Oracle Instant and Sqlplus in Fedora</title><content type='html'>In case you are working against Oracle database, and don't want to install the whole Oracle DB mess, just want to use the sqlplus to connect to an existing db. Then see &lt;a href="http://www.ioncannon.net/system-administration/114/using-oracle-instant-client-and-sqlplus/"&gt;this post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I installed                           &lt;a href="http://download.oracle.com/otn/linux/instantclient/112010/oracle-instantclient11.2-basic-11.2.0.1.0-1.i386.rpm" name="file28" onclick="youMustAgreePrompt();" class="boldbodylink"&gt;oracle-instantclient11.2-basic-11.2.0.1.0-1.i386.rpm&lt;/a&gt; and &lt;span class="textA"&gt;                         &lt;a href="http://download.oracle.com/otn/linux/instantclient/112010/oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.i386.rpm" name="file34" onclick="youMustAgreePrompt();" class="boldbodylink"&gt;oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.i386.rpm&lt;/a&gt; &lt;/span&gt; in my box. (Fedora 10)&lt;br /&gt;&lt;br /&gt;Once you connect it successfully. simply run:&lt;br /&gt;&lt;blockquote&gt;select table_name from tabs;&lt;br /&gt;&lt;/blockquote&gt; to show the tables from your connected database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7181177899397202577?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7181177899397202577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7181177899397202577&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7181177899397202577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7181177899397202577'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/01/using-oracle-instant-and-sqlplus-in.html' title='Using Oracle Instant and Sqlplus in Fedora'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1788843336682837970</id><published>2010-01-07T17:13:00.003+08:00</published><updated>2010-01-07T17:48:09.822+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BPMN'/><title type='text'>Hightlights from BPMN2.0</title><content type='html'>&lt;a href="http://www.processmodeling.info/"&gt;Rick Geneva&lt;/a&gt; has put a set of "hightlights from BPMN2.0" blog entries, very great tutorial on BPMN2.0.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.processmodeling.info/posts/highlights-from-bpmn-2-0-activity-types/"&gt;Highlights from BPMN 2.0: Activity Types&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.processmodeling.info/posts/highlights-from-bpmn-2-0-artifact-shapes/"&gt;Highlights from BPMN 2.0: Artifact Shapes&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.processmodeling.info/posts/highlights-from-bpmn-2-0-event-gateways/"&gt;Highlights from BPMN 2.0: Event Gateways&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.processmodeling.info/posts/highlights-from-bpmn-2-0-non-interrupting-events/"&gt;Highlights from BPMN 2.0: Non-Interrupting Events&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.processmodeling.info/posts/highlights-from-bpmn-2-0-new-event-types/"&gt;Highlights from BPMN 2.0: New Event Types&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;I believe we will see more to come in this series.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1788843336682837970?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1788843336682837970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1788843336682837970&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1788843336682837970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1788843336682837970'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2010/01/hightlights-from-bpmn20.html' title='Hightlights from BPMN2.0'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4347047405075446543</id><published>2009-12-12T15:28:00.003+08:00</published><updated>2009-12-12T15:38:54.853+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Install VirtualBox and Chrome beta in Fedora 10</title><content type='html'>Just installed the VirtualBox in my Fedora 10 box by following &lt;a href="http://randell.ph/geeky/2009/03/27/install-windows-xp-sp2-via-sun-virtualbox-in-fedora-10/"&gt;this blog entry&lt;/a&gt;. It works great. If you live in China, you know you have to use MS's Internet Explore in some cases, like online bank. So it would be neat that having a virtual box, and having a Windoows installed.  Noticed that google roll out the &lt;a href="http://www.google.com/chrome"&gt;linux version of Chrome&lt;/a&gt;, althought it is just beat version, tried it, seems good.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4347047405075446543?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4347047405075446543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4347047405075446543&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4347047405075446543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4347047405075446543'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/12/install-virtualbox-and-chrome-beta-in.html' title='Install VirtualBox and Chrome beta in Fedora 10'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4910741719252530979</id><published>2009-12-05T23:47:00.004+08:00</published><updated>2009-12-05T23:51:30.653+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JPA'/><title type='text'>JPA implementation patterns</title><content type='html'>Found a very good series on&lt;a href="http://blog.xebia.com/2009/07/13/jpa-implementation-patterns-wrap-up/"&gt; JPA implementation patterns&lt;/a&gt;, it was written by &lt;a href="http://blog.xebia.com/author/vpartington/"&gt;Vincent Partington&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4910741719252530979?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4910741719252530979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4910741719252530979&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4910741719252530979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4910741719252530979'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/12/jpa-implementation-patterns.html' title='JPA implementation patterns'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3842851491963895769</id><published>2009-12-05T23:05:00.006+08:00</published><updated>2009-12-05T23:46:10.171+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>open source projects should really use Git</title><content type='html'>I am starting to work on one task in ODE, titled cleanup JPA impl (&lt;a href="https://issues.apache.org/jira/browse/ODE-704"&gt;https://issues.apache.org/jira/browse/ODE-704&lt;/a&gt;), basically it is a quite large refactoring on DAO layer of ODE project. Because I am not a ODE committer, It is not an easy job to get this task done.&lt;br /&gt;&lt;br /&gt;After talked with &lt;a href="http://rrusin.blogspot.com/"&gt;Rafal Rusin&lt;/a&gt; on the ode IRC channel, he suggested that I create a git project in &lt;a href="http://www.github.com/"&gt;github&lt;/a&gt;, which clones the ode git repo, and then put my jpa refactoring experiment branch in github, once my code has finished, and passed all the tests, they can merge my branch into the ode trunk.&lt;br /&gt;&lt;br /&gt;I've heard of &lt;a href="http://git-scm.com/"&gt;Git&lt;/a&gt; for a while, but didn't get a chance to use it, as currently I am still using the Subversion as SCM repository. One thing that I learnt from history is that try to avoid using branch in SVN or CVS as much as possible, it is really a headache for merging branch back to trunk, so this is very inconvenient for you to try some new feature, or some experiment codes.&lt;br /&gt;&lt;br /&gt;Create a project at Github is very easy, if you have problems, &lt;a href="http://help.github.com/"&gt;GitHub's help&lt;/a&gt; is your friend. I have to say that Github did an awesome job on project hosting, it makes you very easy to browse your code, the diff message between version etc.&lt;br /&gt;&lt;br /&gt;Watching the &lt;a href="http://www.youtube.com/watch?v=4XpnKHJAok8"&gt;Linus' Git talk on Google Tech conf&lt;/a&gt;, very interesting, totally agreed that one pain with centralized repository like CVS or SVN, is that you need to get the commit access for your contribution (I am not saying a small fix, or patch, I meant some large task, or feature etc, which would require multiple patches, and might take one or two weeks), like the case that I am hitting now. Alternatively, if you are hosting code repository by using Git, I can clone it from the url, and pull the changes into my local workspace to make it up-to-date, and then push it into some other repository, once I've finished my task, I will send you my code repository, and then you can take a look at those code to decide if you want to accept my code or not. In this case, I don't need to have a commit permission in advance. Also merge in Git is very easy, it makes collaboration really easy.&lt;br /&gt;&lt;br /&gt;So, I would strongly recommend that every open source project should embrace the Git as scm tool, lets forget about Subversion, CVS. Lets embrace the branch. ;-)&lt;br /&gt;&lt;br /&gt;couple resources that could help you get started with Git.&lt;br /&gt;1. &lt;a href="http://git-scm.com/"&gt;Git website&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.github.com/"&gt;GitHub webiste&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://learn.github.com/"&gt;Learn Git website&lt;/a&gt; (Strongly recommend for learning)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3842851491963895769?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3842851491963895769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3842851491963895769&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3842851491963895769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3842851491963895769'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/12/open-source-projects-should-really-use.html' title='open source projects should really use Git'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2075107097906767987</id><published>2009-12-04T14:55:00.002+08:00</published><updated>2009-12-04T14:59:11.258+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><category scheme='http://www.blogger.com/atom/ns#' term='Others'/><title type='text'>Good presentation about XMPP and Web.</title><content type='html'>Jack Moffitt talked a presentation about &lt;a href="http://www.infoq.com/presentations/Real-Time-Web-with-XMPP"&gt;XMPP and real time web&lt;/a&gt;, it is published at InfoQ, don't miss it if you are trying to work with XMPP and Web, it is very hands-on, and technical oriented.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2075107097906767987?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2075107097906767987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2075107097906767987&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2075107097906767987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2075107097906767987'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/12/good-presentation-about-xmpp-and-web.html' title='Good presentation about XMPP and Web.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8662986262959891868</id><published>2009-11-16T00:11:00.004+08:00</published><updated>2009-11-16T00:29:35.758+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='Microcontainer'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JBoss AS5 MC articles and presentations.</title><content type='html'>&lt;a href="http://in.relation.to/Bloggers/Ales"&gt;Ales&lt;/a&gt; has written a series of &lt;a href="http://www.jboss.org/jbossmc"&gt;JBoss Microcontainer&lt;/a&gt;, which is the core of JBoss AS 5, articles at DZone.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://soa.dzone.com/articles/a-look-inside-jboss-microconta"&gt;component models&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://soa.dzone.com/articles/a-look-inside-jboss-microconta-0"&gt;Advanced Dependency Injection and IoC &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://soa.dzone.com/news/jboss-virtual-file-system"&gt;the Virtual File System&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://java.dzone.com/articles/jboss-microcontainer-classloading"&gt;ClassLoading Layer&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;Also, in the youtube, we've got the four presentations from Scott Stark and Ales at JavaOne.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.jboss.org/events/javaone/javaoneVideo10.html"&gt;JBoss AS5 Deployment Environment&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jboss.org/events/javaone/javaoneVideo11.html"&gt;JBoss AS5 Component Mixture Patterns&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jboss.org/events/javaone/javaoneVideo7.html"&gt;JBoss AS5 Classloading and OSGI&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jboss.org/events/javaone/javaoneVideo6.html"&gt;JBoss Microcontainer Optimization&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;If you want to know more about JBoss Microcontainer, you wouldn't miss the &lt;a href="http://jboss.org/file-access/default/members/jbossmc/freezone/docs/2.0.x/userGuide/index.html"&gt;user guide&lt;/a&gt;, and &lt;a href="http://www.jboss.org/jbossmc"&gt;its homepage&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Happy learning. ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8662986262959891868?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8662986262959891868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8662986262959891868&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8662986262959891868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8662986262959891868'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/11/jboss-as5-mc-articles-and-presentations.html' title='JBoss AS5 MC articles and presentations.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1588944557961115976</id><published>2009-10-29T13:32:00.004+08:00</published><updated>2009-10-29T14:01:09.371+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgresql'/><title type='text'>Create Database and user in Postgres and Mysql.</title><content type='html'>Since I worked in SOA area, haven't touched the database for couple years, although in some projects, I need to test against various database (Mysql, Postgres, Oracle etc), but it is very basic stuff, like create database, users etc.&lt;br /&gt;&lt;br /&gt;This post basically is a memo for me, I need to work with various DBs from time to time, and think it is best to record it in my blog, instead of looking into the manual again. ;-). Also, you could see this is a follow-up post for my previous &lt;a href="http://jeff.familyyu.net/2008/05/postgresql-installationconnection-in.html"&gt;postgres installation blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;1. &lt;u&gt;&lt;b&gt;Postgres&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1) connect Postgres &lt;br /&gt;&lt;blockquote&gt;psql -h localhost -U postgres&lt;/blockquote&gt;&lt;br /&gt;2) add user&lt;br /&gt;&lt;blockquote&gt;create user jeff with password 'jeff'&lt;/blockquote&gt;&lt;br /&gt;3) create database&lt;br /&gt;&lt;blockquote&gt;create database jeffdb&lt;/blockquote&gt;&lt;br /&gt;4) grant db to user&lt;br /&gt;&lt;blockquote&gt;grant all privileges on database jeffdb to jeff&lt;/blockquote&gt;&lt;br /&gt;Log out with "\q" command&lt;br /&gt; &lt;br /&gt;Log in jeffdb through user jeff:&lt;br /&gt;&lt;blockquote&gt;psql -d jeffdb -U jeff&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;u&gt;&lt;b&gt;Mysql&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1) connect mysql&lt;br /&gt;&lt;blockquote&gt;mysql -u root -p 'urpassword'&lt;/blockquote&gt;&lt;br /&gt;2) create database&lt;br /&gt;&lt;blockquote&gt;create database jeffdb&lt;/blockquote&gt;&lt;br /&gt;3) allow user jeff to connect to the server from localhost using the password jeff&lt;br /&gt;&lt;blockquote&gt;grant usage on *.* to jeff@localhost identified by 'jeff';&lt;/blockquote&gt;&lt;br /&gt;4)grant all privileges on the jeffdb database to this user&lt;br /&gt;&lt;blockquote&gt;grant all privileges on jeffdb.* to jeff@localhost ;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Log out and log in through jeff user.&lt;br /&gt;&lt;blockquote&gt;mysql -u jeff -p'jeff' jeffdb&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;1. &lt;a href="http://www.cyberciti.biz/faq/howto-add-postgresql-user-account/"&gt;How to add postgres user and create db&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.debuntu.org/how-to-create-a-mysql-database-and-set-privileges-to-a-user"&gt;Create mysql database and set privileges into a user&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1588944557961115976?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1588944557961115976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1588944557961115976&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1588944557961115976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1588944557961115976'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/10/create-database-and-user-in-postgres.html' title='Create Database and user in Postgres and Mysql.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1711211538153749981</id><published>2009-10-22T00:22:00.005+08:00</published><updated>2009-10-24T19:57:15.662+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><category scheme='http://www.blogger.com/atom/ns#' term='Identity'/><title type='text'>Openfire + jwchat + Tomcat = Realtime collaboration</title><content type='html'>If you are building a web application, you might need customers use IM client to get to you easily, and can communicate with you on real time. Then I would recommend the &lt;a href="http://www.igniterealtime.org/projects/openfire/index.jsp"&gt;Openfire&lt;/a&gt; (IM server) +&lt;a href="http://blog.jwchat.org/jwchat/"&gt; jwchat&lt;/a&gt; (web IM) to build your real time collaboration. All of these two are open source. Openfire also has its enterprise edition.&lt;br /&gt;&lt;br /&gt;Following are two links about how to setup these two. (both of them are written in Chinese).&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://www.javaeye.com/topic/154697?page=1"&gt;构建 基于openfire + jwchat 的 WEB IM&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.cnblogs.com/bluespot/archive/2008/07/17/1243164.html"&gt;Openfire+jwchat linux 下安装记录&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am using the Openfire 3.6.4. But the steps are the same as before.&lt;br /&gt;&lt;br /&gt;Update (Oct-24-2009), if you want to build your own web IM to communicate with Jabber server, then you'd better check out the &lt;a href="http://blog.jwchat.org/jsjac/"&gt;JSJAC library&lt;/a&gt;. One common issue due to the XMLHttpRequest is that is unable to get resource across the domain. Good news is that you could either &lt;a href="http://www.enavigo.com/2008/10/14/setting-up-jsjac-with-openfire-352/"&gt;use the Apache mod_proxy or url rewrite to do so&lt;/a&gt;, or you deploy a JHB servlet like what jwchat war did.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1711211538153749981?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1711211538153749981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1711211538153749981&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1711211538153749981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1711211538153749981'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/10/openfire-jwchat-tomcat-realtime.html' title='Openfire + jwchat + Tomcat = Realtime collaboration'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2385518741665010146</id><published>2009-09-29T01:56:00.002+08:00</published><updated>2009-09-29T02:09:55.995+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>简说XML的Namespace.</title><content type='html'>这是一个简单的XML 101的贴子,写下以帮助自己记忆. ;-)&lt;br /&gt;&lt;br /&gt;XML的namespace属性类似java中的packagename,是为了使得唯一性.在xml schema, wsdl or bpel中,我们一般会看到如下的定义&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;definitions name="echoWsdl"&lt;br /&gt;        targetNamespace="http://www.jboss.org/jeffyu/bpel/wsdl"&lt;br /&gt;        xmlns:tns="http://www.jboss.org/jeffyu/bpel/wsdl"&lt;br /&gt;        xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"&lt;br /&gt;        xmlns="http://schemas.xmlsoap.org/wsdl/"&lt;br /&gt;        xmlns:xsd="http://www.w3.org/2001/XMLSchema"&lt;br /&gt;        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;这里面,就要涉及到我们所要谈的default namespace 和 targetNamespace.&lt;br /&gt;先看普通的定义,比如:&lt;pre class="brush:xml"&gt;&lt;br /&gt;xmlns:xsd="http://www.w3.org/2001/XMLSchema"&lt;/pre&gt;&lt;br /&gt;这样定义后,我们就可以在wsdl文件中写 xsd:string来引用XMLSchema所定义的数据类型,用java理解,可以理解是引入了某个package.&lt;br /&gt;&lt;br /&gt;接着我们来看default namespace.&lt;pre class="brush:xml"&gt;&lt;br /&gt;xmlns="http://schemas.xmlsoap.org/wsdl/"&lt;/pre&gt;&lt;br /&gt;这里,我们可以看到它不像我们上个例子那样定义前缀,那么它就是这个xsd/wsdl/bpel文件中的默认namespace,(注意默认的namespace只适用于没有前缀的element,对attribute不起作用),一个xsd/wsdl文件中只能有一个默认的namespace.&lt;br /&gt;&lt;br /&gt;最后,我们再来看targetNamespace.&lt;pre class="brush:xml"&gt;&lt;br /&gt;targetNamespace="http://www.jboss.org/jeffyu/bpel/wsdl"&lt;/pre&gt;&lt;br /&gt;定义targetNamespace的目的是对在这个xsd/wsdl中自己定义的element(s)归到这个namespace里,也就是说,如果外部的文件要调用这里面的element,那么就需要用这个targetNamespace来调用.所以这也是,当你定义了一个xsd,你要写一个相对应于这个xsd的xml,就需要这个xsd里面的targetNamespace来做校验,看xml是否符合xsd的定义.&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;1. http://www.coderanch.com/t/148016/Web-Services-Certification-SCDJWS/certification/Differences-between-targetNamespace-default-namespace&lt;br /&gt;2. http://www.oracle.com/technology/pub/articles/srivastava_namespaces.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2385518741665010146?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2385518741665010146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2385518741665010146&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2385518741665010146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2385518741665010146'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/09/xmlnamespace.html' title='简说XML的Namespace.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6888358038862044704</id><published>2009-09-28T00:04:00.008+08:00</published><updated>2009-09-28T01:26:36.580+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BPEL'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>PartnerLink,PartnerLinkType详解</title><content type='html'>记得我在看BPEL的时候,总是对PartnerLink和PartnerLinkType概念比较混淆,特别是里面的partnerRole, myRole属性的疑惑,后通过查阅资料,觉得理解得差不多,特分享自己的学习笔记.&lt;br /&gt;&lt;br /&gt;BPEL的出现,最主要是想提供一个业务流程(process)的语法,从另外一个方面,也就是想对已有的服务(这里限定于发布成web service的服务)进行一系列的编制(orchestration),然后变成一个新的服务(默认也是发布成web service). 这从一方面来说,也算是重复利用了已有的服务.&lt;br /&gt;&lt;br /&gt;BPEL Process主要包括了Activity的概念,里面有包括最基本的Receive,Invoke, Reply等primitive Activity,也包括了strcture activity,比如sequence, flow, case等. 那既然我们定义了这些activity,又是怎么跟外部的已有服务进行联系上呢. 那么就是通过我们所要讲的PartnerLink, PartnerLinkType来关联.&lt;br /&gt;&lt;br /&gt;我们先来看下PartnerLinkType. 我比较赞同把PartnerLinkType比喻成通道{Note: 来自于reference[2]的文章}. 可以这么想, BPEL Process是一个web service,这个服务是通过什么方法来与其他已经存在的另外一些web service(s)进行关联呢?PartnerLinkType就是定义这样的一个通道.&lt;br /&gt;&lt;br /&gt;先看下PartnerLinkType的例子.&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;plnk:partnerLinkType name="AuctionHouse_SellerLT"&gt;&lt;br /&gt;&amp;lt;plnk:role name="AuctionHouse" portType="tns:sellerPT" /&gt;&lt;br /&gt;&amp;lt;plnk:role name="Seller" portType="tns:sellerAnswerPT" /&gt;&lt;br /&gt;&amp;lt;/plnk:partnerLinkType&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;注意这里定义的role可以有1个或者2个,在这个例子当中,我们看到的是2个,代表着需要两个portType(类似Java的Interface)来完成这个通道.这种情况一般是属于异步(Asynchronous)的情况. 我们也可以看做是2个的叫做双向,1个的叫做单向. 1个的一般直接是同步(Synchronous)的,可以直接获取到结果的,不用向异步那样需要一个回调方法(callback).&lt;br /&gt;&lt;br /&gt;介绍完PartnerLinkType,可以把PartnerLink想做是PartnerLinkType的实例化.但有点不同的是,在上面我们讲到PartnerLinkType是有单向和双向的,在双向的情况下,那到底是哪个方向呢?比方说,到底是从A -&gt;B 还是从 B -&gt; A呢? PartnerLink的定义就会明确规定了这个方向,比如说:&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;partnerLink name=”seller” &lt;br /&gt;   partnerLinkType=”AuctionHouse_SellerLT”&lt;br /&gt;   myRole=”AuctionHouse” partnerRole=”Seller”&lt;br /&gt;&amp;lt;/partnerLink&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;注意到这里的myRole和partnerRole的属性,这两个属性指明了PartnerLinkType的方向. 这里, MyRole是指BPEL Process, partnerRole是指外部的we service. 那么,这个例子当中就是,这个通道是从bpel process流向exernal web service.也就是有个请求发送到bpel process,然后bpel process通过这个通道,调用到外面的web service,然后外部的web service再传递结果给bpel process.&lt;br /&gt;&lt;br /&gt;这里,我们还得看下单向的情况(也就是在定义PartnerLinkType时,只有一个role的). 比方下面的这个例子.&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;plnk:partnerLinkType name="loanPartnerLT"&gt;&lt;br /&gt;&amp;lt;plnk:role name="loanService" portType="tns:loanServicePT" /&gt;&lt;br /&gt;&amp;lt;/plnk:partnerLinkType&gt;&lt;br /&gt;&amp;lt;plnk:partnerLinkType name="loanApprovalLT"&gt;&lt;br /&gt;&amp;lt;plnk:role name="approver" portType="tns:loanApprovalPT" /&gt;&lt;br /&gt;&amp;lt;/plnk:partnerLinkType&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;再看PartnerLink的定义. &lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;partnerLink  name="customer"&lt;br /&gt;partnerLinkType="lns:loanPartnerLT"&lt;br /&gt;myRole="loanService" /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;partnerLink name="approver"&lt;br /&gt;partnerLinkType="lns:loanApprovalLT"&lt;br /&gt;partnerRole="approver" /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;在这里,第一个customer的partnerLink定义,说明这个管道是从bpel process这个方向开的,也就是说Request的message应该是发到 Bpel Process. 相反的,第二个approver是属于partnerRole,也就是说这个Request Message应该是BPEL Process发给 partner (也就是外部真正提供服务的web service).&lt;br /&gt;&lt;br /&gt;可以推知，凡是partnerLink中定义了myrole的地方，都是外界要调用bpel process的地方，必然对应receive操作.&lt;br /&gt;&lt;br /&gt;注意,因为这个PartnerLinkType是WSDL的一个扩展点,所以很多时候,对于这个PartnerLinkType就直接定义在WSDL文件里,而不放在.bpel文件中.&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;0. &lt;a href="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html"&gt;WSBPEL 2.0 specification&lt;/a&gt;&lt;br /&gt;1. &lt;a href="http://infocenter.activevos.com/infocenter/ActiveVOS/v60/index.jsp?topic=/com.activee.bpel.doc/html/UG8-2.html"&gt;PartnerLinks and PartnerLinkTypes&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.zhaoxiangpeng.com/articles/bpel%E4%B8%AD%E7%9A%84partnerlink%E5%92%8Cpartnerlinktype.html"&gt;BPEL中的PartnerLink和PartnerLinkType&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6888358038862044704?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6888358038862044704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6888358038862044704&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6888358038862044704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6888358038862044704'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/09/partnerlinkpartnerlinktype.html' title='PartnerLink,PartnerLinkType详解'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4633163559005177659</id><published>2009-09-10T13:42:00.002+08:00</published><updated>2009-09-10T13:56:32.375+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Soft delete, or Hard delete.</title><content type='html'>Read the topic of whether we should use the 'soft delete' or 'hard delete' when we are building enterprise application. It was started by &lt;a href="http://ayende.com/Blog/archive/2009/08/30/avoid-soft-deletes.aspx"&gt;Ayende's 'Avoid soft deletes'&lt;/a&gt;, and then &lt;a href="http://www.udidahan.com/2009/09/01/dont-delete-just-dont/"&gt;Udi Dahan says 'don't delete, just dont'&lt;/a&gt;. &lt;a href="http://www.infoq.com/news/2009/09/Do-Not-Delete-Data"&gt;InfoQ has a thread to discuss about it&lt;/a&gt;. Personally, I agree with Udi Dahan. I didn't say that we should always use soft delete. But I would say use it in most cases, compared to the hard delete.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4633163559005177659?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4633163559005177659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4633163559005177659&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4633163559005177659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4633163559005177659'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/09/soft-delete-or-hard-delete.html' title='Soft delete, or Hard delete.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2508964700665936580</id><published>2009-08-11T15:21:00.014+08:00</published><updated>2009-08-11T23:52:53.085+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBossESB'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Service'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Publishing web service in JBoss ESB</title><content type='html'>As of this writing, &lt;a href="http://www.jboss.org/jbossesb"&gt;JBoss ESB 4.6&lt;/a&gt; has two ways of publishing web service for ESB service.&lt;br /&gt;1. Using JSR 181 annotation to do the web service publish and use SOAPProcessor action to connect it in ESB.&lt;br /&gt;2. Providing the in,out, fault xsd schema to generate the wsdl dynamically and publish the web service.&lt;br /&gt;These two ways are not exclusive, it is for different usage:&lt;br /&gt;1. The first one is using JBossWS to publish the annotated Java service, and then using the SOAPProcessor to be a thin wrapper for the existed web service.&lt;br /&gt;2. The second one, which we called EBWS(Endpoint Web Service), is asking developers to provide the in,out,fault xsd if it is required, And then uses these xsds, plus the service info (like service name, category etc) that were defined in the jboss-esb.xml to generate the wsdl and publish the web service.&lt;br /&gt;&lt;br /&gt;The JBoss ESB distribution has both quick start examples for these two scenarios. We will examine them in order shortly, quickstart/webservice_producer sample is using the first approach that we've described, while the quickstart/publish_as_webservice is the EBWS as we said.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;web service producer using SOAPProcessor&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;We will examine the first approach, below are the steps that is required to publish a web service in ESB.&lt;br /&gt;&lt;br /&gt;1.&lt;b&gt;Add the impl class with jsr 181 annotation&lt;/b&gt;&lt;br /&gt;Lets see the GoodbyeWorldWS.java class, this is the class that is supposed to expose as web service.&lt;br /&gt;&lt;pre class="brush:java"&gt;@WebService(name = "GoodbyeWorldWS", targetNamespace="http://webservice_producer/goodbyeworld")&lt;br /&gt;public class GoodbyeWorldWS {&lt;br /&gt;@WebMethod&lt;br /&gt;public String sayGoodbye(@WebParam(name="message") String message) {&lt;br /&gt;&lt;br /&gt;   Message esbMessage = SOAPProcessor.getMessage();&lt;br /&gt;   if(esbMessage != null) {&lt;br /&gt;       System.out.println("**** SOAPRequest perhaps mediated by ESB:\n" + esbMessage.getBody().get());&lt;br /&gt;   }&lt;br /&gt;   System.out.println("Web Service Parameter - message=" + message);&lt;br /&gt;   return "... Ah Goodbye then!!!! - " + message;&lt;br /&gt;}&lt;br /&gt;....&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;You can see that we are using the jsr181 annotation to expose it as web service. Noted that we are using the SOAPProcessor class to get the incoming soap message just for demonstration, you don't have to use it in this class's implementation.&lt;br /&gt;&lt;br /&gt;2.&lt;b&gt;Add web.xml to deploy it in servlet container&lt;/b&gt;&lt;br /&gt;In the $webservice_producer/war/resources/WEB-INF/web.xml, it looks like&lt;br /&gt;&amp;lt;servlet&gt;&lt;br /&gt;&lt;pre class="brush:xml"&gt;        &amp;lt;servlet-name&gt;GoodbyeWorldWS&amp;lt;/servlet-name&gt;&lt;br /&gt;   &amp;lt;servlet-class&gt;org.jboss.soa.esb.samples.quickstart.webserviceproducer.webservice.GoodbyeWorldWS&lt;br /&gt;&amp;lt;/servlet&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;servlet-mapping&gt;&lt;br /&gt;   &amp;lt;servlet-name&gt;GoodbyeWorldWS&amp;lt;/servlet-name&gt;&lt;br /&gt;   &amp;lt;url-pattern&gt;/GoodbyeWorldWS&amp;lt;/url-pattern&gt;&lt;br /&gt;&amp;lt;/servlet-mapping&gt;&lt;br /&gt;&lt;/pre&gt;Typically, we can build a war file that includes both web.xml and the GoodbyeWorldWS.class, and it should be enough to be published as a web service through JBoss WS. since we are trying to access the web service through our ESB, so we need to define an extra file (jboss-esb.xml) in our case.&lt;br /&gt;&lt;br /&gt;3.&lt;b&gt;Add SOAPProcessor in the jboss-esb.xml&lt;/b&gt;&lt;br /&gt;In the jboss-esb.xml service section, we need to use the SOAPProcessor as following:&lt;pre class="brush:xml"&gt;&amp;lt;action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor"&gt;&lt;br /&gt;&amp;lt;property name="jbossws-endpoint" value="GoodbyeWorldWS"/&gt;&lt;br /&gt;&amp;lt;/action&gt;&lt;br /&gt;&lt;/pre&gt;Here the "jbossws-endpoint" property should be referred to published web service servlet name.&lt;br /&gt;*&lt;span style="color: rgb(255, 0, 0);"&gt;Tip&lt;/span&gt;: There's one optional property "rewrite-endpoint-url" which is not used in this sample. This property is to support load balance on HTTP endpoints.&lt;br /&gt;&lt;br /&gt;4.&lt;b&gt;pack them in esb and war archive&lt;/b&gt;&lt;br /&gt;The last step for us it to pack them and then deploy. The war file will include all needed classes and web.xml to publish web service. The esb file will include all needed esb files, like jboss-esb.xml etc. You can bundle the war file into esb archive, which is the way that sample uses.&lt;br /&gt;&lt;br /&gt;Until now, we've described all of important steps. Next, we will deploy this esb archive into ESB server, you can see the wsdl file at: http://localhost:8080/contract/ (This is offered by ESB), or you can see the one from http://localhost:8080/jbossws/services, that is offered by JBoss WS.&lt;br /&gt;&lt;br /&gt;5.&lt;b&gt;Add the client to do the test&lt;/b&gt;&lt;br /&gt;So, we've completed our server side work. In the example, we defined three gateway for this web service, for the simplicity, we will just look at the one uses JBR gateway to do the test in our client. Here is the client code:&lt;pre class="brush:java"&gt;   private void sendMessageToJBRListener(String protocol, int port, String message) throws Throwable {&lt;br /&gt;   String locatorURI = protocol + "://localhost:" + port;&lt;br /&gt;   InvokerLocator locator = new InvokerLocator(locatorURI);&lt;br /&gt;   System.out.println("Calling JBoss Remoting Listener using locator URI: " + locatorURI);&lt;br /&gt;&lt;br /&gt;   Client remotingClient = null;&lt;br /&gt;   try {&lt;br /&gt;       remotingClient = new Client(locator);&lt;br /&gt;       remotingClient.connect();&lt;br /&gt;&lt;br /&gt;       // Deliver the message to the listener...&lt;br /&gt;       Object response = remotingClient.invoke(message);&lt;br /&gt;       System.out.println("JBR Class: " + response.getClass().getName());&lt;br /&gt;       System.out.println("Response from JBoss Remoting Listener '" + locatorURI + "' was '" + response + "'.");&lt;br /&gt;   } finally {&lt;br /&gt;       if(remotingClient != null) {&lt;br /&gt;           remotingClient.disconnect();&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;We are using the following soap message in our client as input. &lt;pre class="brush:xml"&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://webservice_producer/goodbyeworld"&gt;&lt;br /&gt;&amp;lt;soapenv:Header/&gt;&lt;br /&gt;&amp;lt;soapenv:Body&gt;&lt;br /&gt; &amp;lt;good:sayGoodbye&gt;&lt;br /&gt;    &amp;lt;message&gt;Goodbye!!&lt;br /&gt; &amp;lt;/good:sayGoodbye&gt;&lt;br /&gt;&amp;lt;/soapenv:Body&gt;&lt;br /&gt;&amp;lt;/soapenv:Envelope&gt;&lt;br /&gt;&lt;/pre&gt;Run the "ant deploy" to deploy the server into ESB server; Run the 'ant runtest', you would get following result:&lt;pre class="brush:xml"&gt;saygoodbye_over_http:&lt;br /&gt;[echo] Invoking a JBossWS Endpoint over HTTP (via JBoss ESB).&lt;br /&gt;[java] Calling JBoss Remoting Listener using locator URI: http://localhost:8765&lt;br /&gt;[java] JBR Class: java.lang.String&lt;br /&gt;[java] Response from JBoss Remoting Listener 'http://localhost:8765' was '&amp;lt;env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'&gt;&amp;lt;env:Header&gt;&amp;lt;/env:Header&gt;&amp;lt;env:Body&gt;&amp;lt;ns2:sayGoodbyeResponse xmlns:ns2="http://webservice_producer/goodbyeworld"&gt;&amp;lt;return&gt;... Ah Goodbye then!!!! - Goodbye!!&amp;lt;/return&gt;&amp;lt;/ns2:sayGoodbyeResponse&gt;&amp;lt;/env:Body&gt;&amp;lt;/env:Envelope&gt;'.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;u&gt;ESB End Point Web Service&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Now, we will see the End Point Web Service, the corresponding example is publish_as_webservice in the JBoss ESB distribution. Lets also see it step by step.&lt;br /&gt;&lt;br /&gt;1.&lt;b&gt;The Web Service server class&lt;/b&gt;&lt;br /&gt;firstly, take a look at the server impl class. &lt;pre class="brush:java"&gt;public class ESBWSListenerAction extends AbstractActionLifecycle&lt;br /&gt;{&lt;br /&gt;protected ConfigTree _config;&lt;br /&gt;&lt;br /&gt;public ESBWSListenerAction(ConfigTree config)&lt;br /&gt;{&lt;br /&gt;   _config = config;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Message displayMessage(Message message) throws Exception&lt;br /&gt;{&lt;br /&gt;.......&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Is it just an ordinary ESB action? right, it is. This is totally different from the first one that we saw earlier, we do not have annotation, we used the ESB's Message Object as input/output parameter.&lt;br /&gt;&lt;br /&gt;* &lt;span style="color: rgb(255, 0, 0);"&gt;Note&lt;/span&gt;: In this approach, you can view it as Dispatch/Provider way that we used to have in JAX-WS, it means you deal with the raw soap message directly, the server doesn't help you do the unmarshall work, this is also a very big difference from the first approach.&lt;br /&gt;&lt;br /&gt;2. &lt;b&gt; define request, response, fault xsd&lt;/b&gt;&lt;br /&gt;In this example, we just define the in and out xsd. it is as following:&lt;br /&gt;request.xsd&lt;pre class="brush:xml"&gt;&amp;lt;xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"&gt;&lt;br /&gt;&amp;lt;xs:element name="sayHi" type="x1:sayHi"/&gt;&lt;br /&gt;&amp;lt;xs:complexType name="sayHi"&gt;&lt;br /&gt;&amp;lt;xs:sequence&gt;&lt;br /&gt; &amp;lt;xs:element name="arg0" type="xs:string" minOccurs="1"/&gt;&lt;br /&gt;&amp;lt;/xs:sequence&gt;&lt;br /&gt;&amp;lt;/xs:complexType&gt;&lt;br /&gt;&amp;lt;/xs:schema&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Response.xsd&lt;pre class="brush:xml"&gt;&amp;lt;xs:schema version="1.0" targetNamespace="http://www.jboss.org/sayHi" xmlns:x1="http://www.jboss.org/sayHi"  xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"&gt;&lt;br /&gt;&amp;lt;xs:element name="sayHiResponse" type="x1:sayHiResponse"/&gt;&lt;br /&gt;&amp;lt;xs:complexType name="sayHiResponse"&gt;&lt;br /&gt;&amp;lt;xs:sequence&gt;&lt;br /&gt; &amp;lt;xs:element name="arg0" type="xs:string" minOccurs="0"/&gt;&lt;br /&gt;&amp;lt;/xs:sequence&gt;&lt;br /&gt;&amp;lt;/xs:complexType&gt;&lt;br /&gt;&amp;lt;/xs:schema&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We won't show the fault.xsd for the simplicity.&lt;br /&gt;&lt;br /&gt;3.&lt;b&gt; Add xsd file in the jboss-esb.xml&lt;/b&gt;&lt;br /&gt;After we've defined the xsd file, we will add it in the jboss-esb.xml like following. &lt;pre class="brush:xml"&gt;       &amp;lt;actions  inXsd="/request.xsd" outXsd="/response.xsd" faultXsd="/fault.xsd"&gt;&lt;br /&gt;              &amp;lt;action name="action" class="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.ESBWSListenerAction" process="displayMessage"/&gt;&lt;br /&gt;       &amp;lt;/actions&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;*Tip: Here it use the 'service name' + hard code name, like 'Binding' for binding, 'Op' for operation name in the generated wsdl. Refer to ESBServiceEndpointInfo class for its detail.&lt;br /&gt;&lt;br /&gt;4.&lt;b&gt;build it as an esb artifact and deploy&lt;/b&gt;&lt;br /&gt;The last step is to build them as an esb archive and deploy it into the ESB server, as same as the first approach, you can see its wsdl file through either http://localhost:8080/contract or http://localhost:8080/jbossws/services.&lt;br /&gt;&lt;br /&gt;The client is as same as the first one(apart from the soap message and url), so I won't show it again.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;You see two approaches to help you publish web service in JBoss ESB. At first glance, you might think EBWS(second approach here) is simple as you don't need to build the war file etc. But I would say the first approach is more common in the real use case.&lt;br /&gt;&lt;br /&gt;[Acknowledgement]&lt;br /&gt;I'd like to thank my colleague &lt;a href="http://maerqiang.blogspot.com/"&gt;Jim Ma&lt;/a&gt; for help me explain these two approaches on publishing web service.&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;1. &lt;a href="http://www.jboss.org/jbossesb"&gt;JBoss ESB website&lt;/a&gt;.&lt;br /&gt;2. &lt;a href="http://www.mastertheboss.com/en/soa-a-esb/137-jboss-esb-webservice-producer.html"&gt;JBoss ESB Webservice Producer.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2508964700665936580?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2508964700665936580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2508964700665936580&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2508964700665936580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2508964700665936580'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/08/publishing-web-service-in-jboss-esb.html' title='Publishing web service in JBoss ESB'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1121236765145740557</id><published>2009-08-08T18:14:00.014+08:00</published><updated>2009-08-09T17:25:13.391+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RESTEasy'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='jBPM'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>jBPM 4.0 restful service introduction.</title><content type='html'>We all knew that we've had a completely re-write console that is using GWT in jBPM 4.0.  But we might not know that we've also introduced a set of jbpm restful service. Specifically, it is including following resources: Process Management, Task Management, User Management, Process Engine service etc. These resources are exchanged by using json as data format. The jBPM console (&lt;a href="http://localhost:8080/jbpm-console"&gt;http://localhost:8080/jbpm-console&lt;/a&gt;) operates jbpm services through this restful services.&lt;br /&gt;&lt;br /&gt;Assume that you've installed the jBPM 4.0, started the server, you can see all available services at &lt;a href="http://localhost:8080/gwt-console-server/rs/server/resources"&gt;http://localhost:8080/gwt-console-server/rs/server/resources&lt;/a&gt; url. This page basically lists the most important information for the services, like the Method (could be GET, POST etc), the url, consume and produce data format etc.&lt;br /&gt;&lt;br /&gt;Now, lets look at how many components are consist of this restful service. In the jBPM server, we can find following three packages.&lt;pre class="brush:xml"&gt;$JBoss/server/default/lib/gwt-console-rpc.jar&lt;br /&gt;$JBoss/server/default/lib/gwt-console-server-integration.jar&lt;br /&gt;$JBoss/server/default/deploy/jbpm/gwt-console-server.war&lt;br /&gt;&lt;/pre&gt;These three libraries is the backbone of our restful services.&lt;br /&gt;1. &lt;u&gt;gwt-console-rpc.jar&lt;/u&gt;: this jar includes all the domain classes that server used to expose. In other word, this jar define all of data format that we are going to expose to the client.&lt;br /&gt;2. &lt;u&gt;gwt-console-server-integration&lt;/u&gt;: This package includes all of abstracted SPIs(Service Provider Interface), like TaskManagement etc. jBPM integration layer uses this to implement these SPIs.&lt;br /&gt;3. &lt;u&gt;gwt-console-server.war&lt;/u&gt;: This artifact extends the rpc and server-integration modules(the artifacts in the default/deploy folder will see all libaries in the default/lib folder) , also leverages the RESTEasy lib to expose all of service to be restful. (here we are using the RESTEasy's jaxb-json provider to expose all the domain model into json data format.)&lt;br /&gt;&lt;br /&gt;*&lt;span style="color: rgb(255, 0, 0);"&gt; Tip&lt;/span&gt;: we've put all of jBPM related API into the jbpm.jar itself (you can find it under the $JBoss/server/default/lib/jbpm.jar). For the jBPM integration point, we are getting the ProcessEngine API from the JNDI at "java:/ProcessEngine".&lt;br /&gt;&lt;br /&gt;Now you saw these services. Next I will write a simple test to use this service to show you how you can leverage it.&lt;br /&gt;&lt;br /&gt;For its simplicity, I won't do it in the html, that is what jBPM console did, here I will write a test client, and then use the &lt;a href="http://code.google.com/p/google-gson/"&gt;Gson library&lt;/a&gt; to convert the json into our domain model(in our gwt-console-rpc).&lt;pre class="brush:java"&gt;&lt;br /&gt;public class RestfulServiceTest extends TestCase {&lt;br /&gt;&lt;br /&gt;  public void testDeploymentRestfulService() throws Exception {&lt;br /&gt;      URL url = new URL("http://localhost:8080/gwt-console-server/rs/engine/deployments");&lt;br /&gt;      HttpURLConnection connection = (HttpURLConnection)url.openConnection();&lt;br /&gt;      connection.setRequestMethod("GET");&lt;br /&gt;&lt;br /&gt;      BufferedReader reader = new BufferedReader(new&lt;br /&gt;                InputStreamReader(connection.getInputStream()));&lt;br /&gt;   &lt;br /&gt;      StringBuffer buffer = new StringBuffer();&lt;br /&gt;      String line = reader.readLine();&lt;br /&gt;      while (line != null)&lt;br /&gt;      {&lt;br /&gt;       buffer.append(line);&lt;br /&gt;       line = reader.readLine();&lt;br /&gt;      }&lt;br /&gt;   &lt;br /&gt;      System.out.println(buffer.toString());&lt;br /&gt;   &lt;br /&gt;      Gson gson = new Gson();&lt;br /&gt;      DeploymentRefWrapper result = gson.fromJson(buffer.toString(), DeploymentRefWrapper.class);&lt;br /&gt;   &lt;br /&gt;      for (DeploymentRef deploymentRef : result.getDeployments()) {&lt;br /&gt;          System.out.println("deployment name is: " + deploymentRef.getName());&lt;br /&gt;      }&lt;br /&gt;  &lt;br /&gt;      connection.disconnect();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Before you run the above code, you need to make sure that you've started the jBPM 4.0, and deployed a bar file into the server. Otherwise you would see nothing, as there were no data on the server. (you can refer to &lt;a href="http://jeff.familyyu.net/search/label/jBPM"&gt;my previous blogs&lt;/a&gt; if you don't know how to start and deploy bar artifact into server).&lt;br /&gt;&lt;br /&gt;* &lt;span style="color: rgb(255, 0, 0);"&gt;Note&lt;/span&gt;: You need to add the gson lib in your classpath.&lt;br /&gt;&lt;br /&gt;Run the test code, you would get following result.&lt;pre class="brush:xml"&gt;&lt;br /&gt;{"deployments":[{"id":"1","suspended":false,"name":"helloworld.bar","timestamp":1249805642238,"definitions":["helloworld-1"],"resourceNames":["review.ftl","META-INF/","META-INF/MANIFEST.MF","helloworld.jpdl.xml","helloworld.png"]}]}&lt;br /&gt;&lt;br /&gt;deployment name is: helloworld.bar&lt;/pre&gt;&lt;br /&gt;First one is the whole data in json format.&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;1. &lt;a href="http://www.jboss.org/community/wiki/BPMConsoleReference"&gt;BPM Console Reference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1121236765145740557?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1121236765145740557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1121236765145740557&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1121236765145740557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1121236765145740557'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/08/jbpm-40-restful-service-introduction.html' title='jBPM 4.0 restful service introduction.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-625026525176723857</id><published>2009-08-02T18:44:00.023+08:00</published><updated>2009-08-03T00:10:58.888+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RESTEasy'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Build restful service with RESTEasy</title><content type='html'>Haven't used JAX-RS to build RESTful service for a while, these days I look at the BPM console project, and one thing is that its service are all rest services. So I tried to build a restful service with &lt;a href="http://jboss.org/resteasy/"&gt;RESTEasy&lt;/a&gt; library to see how it goes. Hope this blog entry could help people who are also trying to build Restful service with RESTEasy. I am using the RESTEasy 1.1.GA version in our example.&lt;br /&gt;&lt;br /&gt;If you are still working on the REST topic, then take a look at &lt;a href="http://jeff.familyyu.net/2008/08/rest-articles-link.html"&gt;this resource&lt;/a&gt;, also I strongly recommend that you have a read on 《Restful webservice》if possible. I will build a restful-blog project as our helloworld, and will look into it from three aspects: build, deployment and unit test.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Build the Project&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1.&lt;b&gt;create a project and add the resteasy lib&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Firstly, lets create the project, I am using the m2eclipse plugin to create a maven blank project. Open up the pom.xml, add the resteay-jaxrs, resteasy-jaxb-provider libs in our pom.xml, in order to download the resteasy-jaxrs, you need to add the jboss maven repo in the repository.&lt;br /&gt;The repository and the dependency would be like:&lt;pre class="brush:xml"&gt;&lt;br /&gt; &amp;lt;repositories&gt;&lt;br /&gt;  &amp;lt;repository&gt;&lt;br /&gt;   &amp;lt;id&gt;JBossMavenRepo&amp;lt;/id&gt;&lt;br /&gt;   &amp;lt;name&gt;JBoss Maven2 repo&amp;lt;/name&gt;&lt;br /&gt;   &amp;lt;url&gt;http://repository.jboss.org/maven2&amp;lt;/url&gt;&lt;br /&gt;   &amp;lt;releases&gt;&lt;br /&gt;    &lt;enabled&gt;true&amp;lt;/enabled&gt;&lt;br /&gt;   &amp;lt;/releases&gt;&lt;br /&gt;   &amp;lt;snapshots&gt;&lt;br /&gt;    &lt;enabled&gt;false&amp;lt;/enabled&gt;&lt;br /&gt;   &amp;lt;/snapshots&gt;&lt;br /&gt;  &amp;lt;/repository&gt;&lt;br /&gt; &amp;lt;/repositories&gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;dependencies&gt; &lt;br /&gt;  &amp;lt;dependency&gt;&lt;br /&gt;   &amp;lt;groupId&gt;junit&amp;lt;/groupId&gt;&lt;br /&gt;   &amp;lt;artifactId&gt;junit&amp;lt;/artifactId&gt;&lt;br /&gt;   &amp;lt;version&gt;4.4&amp;lt;/version&gt;&lt;br /&gt;   &amp;lt;scope&gt;test&amp;lt;/scope&gt;&lt;br /&gt;  &amp;lt;/dependency&gt;&lt;br /&gt;  &amp;lt;dependency&gt;&lt;br /&gt;   &amp;lt;groupId&gt;org.jboss.resteasy&amp;lt;/groupId&gt;&lt;br /&gt;   &amp;lt;artifactId&gt;resteasy-jaxrs&amp;lt;/artifactId&gt;&lt;br /&gt;   &amp;lt;version&gt;1.1.GA&amp;lt;/version&gt;&lt;br /&gt;  &amp;lt;/dependency&gt;&lt;br /&gt;  &amp;lt;dependency&gt;&lt;br /&gt;   &amp;lt;groupId&gt;org.jboss.resteasy&amp;lt;/groupId&gt;&lt;br /&gt;   &amp;lt;artifactId&gt;resteasy-jaxb-provider&amp;lt;/artifactId&gt;&lt;br /&gt;   &amp;lt;version&gt;1.1.GA&amp;lt;/version&gt;&lt;br /&gt;  &amp;lt;/dependency&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Run: mvn eclipse:eclipse, it should generate all the eclipse needed workspace files.&lt;br /&gt;&lt;br /&gt;2. &lt;b&gt;Build the Resource service&lt;/b&gt;&lt;br /&gt;Here, I created the UserService interface, which takes care of users CRUD operation, and UserServiceImpl to implement UserService. I am a guy that like to keep the API and implementation separated as much as possible. (Because I found people would typically created a resource class directly in building restful service. like they would name it as UserResource class directly, don't have UserService interface. I still prefer to have interface as the contract.) As the JAX-RS 1.0 spec supports that put the annotation on its interface, so it is ok for us to keep API and impl separated.&lt;br /&gt;&lt;br /&gt;Lets look at the UserService firstly.&lt;pre class="brush:java"&gt;&lt;br /&gt;public interface UserService {&lt;br /&gt;  &lt;br /&gt; @GET&lt;br /&gt; @Path("{id}")&lt;br /&gt; @Produces({"application/xml"})&lt;br /&gt; public User getUser(@PathParam("id") long id);&lt;br /&gt; &lt;br /&gt; @POST&lt;br /&gt; @Consumes("application/xml")&lt;br /&gt; public Response addUser(User user);&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;JAX-RS spec introduced a set of annotations to help us to expose the java bean as RESTful service.&lt;br /&gt;&lt;br /&gt;@Path: This annotation defines which url that we are trying to expose our service to.&lt;br /&gt;@GET:  We know that we have five operations in HTTP, they are GET, PUT, POST, DELETE and HEAD. This annotation is mapped to HTTP's GET, it means you need to use the GET method to access the url to get this resource.&lt;br /&gt;@POST: Mapped to the HTTP's POST.&lt;br /&gt;@Produces: This annotation defines which media type that this method(every method is a resource here) produced.&lt;br /&gt;@Consumes:This annotation is opposed to the @Produces, this one specifies what kind of media type (format) is expected for this method(resource)&lt;br /&gt;@PathParam: This means we will extract the id value from the url path. Other params are: QueryParam, CookieParam, HeaderParam, FormParam etc.&lt;br /&gt;&lt;br /&gt;The 'Response' object is a JAX-RS spec defined return type. Client is able to get this object from the HTTP's Response object.&lt;br /&gt;&lt;br /&gt;Now, let's look at User Object itself,&lt;br /&gt;&lt;pre class="brush:java"&gt;@XmlRootElement(name="user")&lt;br /&gt;public class User {&lt;br /&gt;&lt;br /&gt; @XmlAttribute&lt;br /&gt; public long getId() {&lt;br /&gt;  return id;&lt;br /&gt; } &lt;br /&gt; @XmlElement&lt;br /&gt; public String getUsername() {&lt;br /&gt;  return username;&lt;br /&gt; } &lt;br /&gt; @XmlElement&lt;br /&gt; public String getEmail() {&lt;br /&gt;  return email;&lt;br /&gt; }&lt;br /&gt;.....&lt;br /&gt;}&lt;/pre&gt;Here, I omitted the class memeber and its setter methods. You can see that our domain object has the JAXB specific annotation.&lt;br /&gt;&lt;br /&gt;Let's step back and look at what we are trying to do in the UserService, we want client to send a xml file over HTTP to add a User, so we need to have a data binding lib that convert the xml to Java Object, thats the reason that we introduced the JAXB annotation.&lt;br /&gt;&lt;br /&gt;Our User Object corresponding xml would be like following:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&amp;lt;user id="1"&gt;&lt;br /&gt; &amp;lt;username&gt;TestUser&amp;lt;/username&gt;&lt;br /&gt; &amp;lt;email&gt;testuser@test.com&amp;lt;/email&gt;&lt;br /&gt;&amp;lt;/user&gt;&lt;br /&gt;&lt;/pre&gt;Now, let's look at the UserServiceImpl class.&lt;br /&gt;&lt;pre class="brush:java"&gt;@Path("/user")&lt;br /&gt;public class UserServiceImpl implements UserService{&lt;br /&gt; &lt;br /&gt;   private Map userDB = new ConcurrentHashMap();&lt;br /&gt;   private AtomicLong idCounter = new AtomicLong();&lt;br /&gt; &lt;br /&gt; public UserServiceImpl() {&lt;br /&gt;  User user = new User();&lt;br /&gt;  user.setId(100);&lt;br /&gt;  user.setUsername("jeff.yuchang");&lt;br /&gt;  user.setEmail("jeff.yuchang@jboss.org");&lt;br /&gt;  userDB.put(Long.valueOf(100), user);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public Response addUser(User user) {&lt;br /&gt;  user.setId(idCounter.getAndIncrement());&lt;br /&gt;  userDB.put(user.getId(), user);&lt;br /&gt;  System.out.println("User was created, its id " + user.getId());&lt;br /&gt;  return Response.created(URI.create("/user/" + user.getId())).build();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public User getUser(long id) {&lt;br /&gt;  final User user = userDB.get(Long.valueOf(id));&lt;br /&gt;  if (null == user) {&lt;br /&gt;   throw new WebApplicationException(Response.Status.NOT_FOUND);&lt;br /&gt;  }&lt;br /&gt;  return user;&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is a very simple implementation, you would understand it easily.&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Note:&lt;/span&gt; Here we got one thing to note is that we've used the '@Path' in our impl, we didn't include this in our UserService interface, the reason that I am doing so is because I didn't make it work when I deployed it into the Servlet container.&lt;br /&gt;Until now, we've built a very simple resource, next is to deploy it under container, and then we can check it through browser or HttpClient code etc.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Deploy it into Servlet Container&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;In order to deploy our restful resource into Servlet container, we still need to add one class, which needs to extends the 'Application' object that defined in the JAX-RS. we can simply view the Application as a registry that allows us to register our resource into system.&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;public class BlogApplication extends Application {&lt;br /&gt; &lt;br /&gt;   private Set&amp;lt;Object&gt; singletons = new HashSet&amp;lt;Object&gt;();&lt;br /&gt;   private Set&amp;lt;Class&amp;lt;?&gt;&gt; empty = new HashSet&amp;lt;Class&amp;lt;?&gt;&gt;(); &lt;br /&gt;   &lt;br /&gt;   public BlogApplication() {&lt;br /&gt;    singletons.add(new UserServiceImpl());&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt; @Override&lt;br /&gt; public Set&amp;lt;Class&amp;lt;?&gt;&gt; getClasses() {&lt;br /&gt;  return empty;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;    @Override&lt;br /&gt;    public Set&amp;lt;Object&gt; getSingletons() {&lt;br /&gt;       return singletons;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Once we've finished the Application class, we need to add the web.xml and then use the maven-war plugin file to build a war.&lt;br /&gt;&lt;br /&gt;The web.xml is as following:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;web-app&gt;&lt;br /&gt;    &amp;lt;display-name&gt;restful-blog&amp;lt;/display-name&gt;&lt;br /&gt;     &lt;br /&gt;    &amp;lt;context-param&gt;&lt;br /&gt;      &amp;lt;param-name&gt;javax.ws.rs.core.Application&amp;lt;/param-name&gt;&lt;br /&gt;      &amp;lt;param-value&gt;org.jboss.resteasy.blog.BlogApplication&amp;lt;/param-value&gt;&lt;br /&gt;   &amp;lt;/context-param&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;listener&gt;&lt;br /&gt;        &amp;lt;listener-class&gt;org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap&amp;lt;/listener-class&gt;&lt;br /&gt;    &amp;lt;/listener&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;servlet&gt;&lt;br /&gt;        &amp;lt;servlet-name&gt;Resteasy&amp;lt;/servlet-name&gt;&lt;br /&gt;        &amp;lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&amp;lt;/servlet-class&gt;&lt;br /&gt;    &amp;lt;/servlet&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;servlet-mapping&gt;&lt;br /&gt;        &amp;lt;servlet-name&gt;Resteasy&amp;lt;/servlet-name&gt;&lt;br /&gt;        &amp;lt;url-pattern&gt;/*&amp;lt;/url-pattern&gt;&lt;br /&gt;    &amp;lt;/servlet-mapping&gt;&lt;br /&gt;&amp;lt;/web-app&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Also, add the maven-war-plugin into your pom.xml, like &lt;pre class="brush:xml"&gt;&lt;br /&gt;        &amp;lt;plugin&gt;&lt;br /&gt;          &amp;lt;groupId&gt;org.apache.maven.plugins&amp;lt;/groupId&gt;&lt;br /&gt;          &amp;lt;artifactId&gt;maven-war-plugin&amp;lt;/artifactId&gt;&lt;br /&gt;          &amp;lt;version&gt;2.0&amp;lt;/version&gt;&lt;br /&gt;          &amp;lt;configuration&gt;&lt;br /&gt;            &amp;lt;webappDirectory&gt;src/webapp&amp;lt;/webappDirectory&gt;&lt;br /&gt;          &amp;lt;/configuration&gt;&lt;br /&gt;       &amp;lt;/plugin&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, run the mvn clean install, you would see the restful-blog-1.0-SNAPSHOT.war in the target folder. &lt;br /&gt;&lt;br /&gt;Copy it into the $Tomcat/webapps, start the tomcat, and then access the following url: http://localhost:8080/restful-blog-1.0-SNAPSHOT/user/100, you should see the following xml file.&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;user id="100"&gt;&lt;br /&gt;&amp;lt;email&gt;jeff.yuchang@jboss.org&amp;lt;/email&gt;&lt;br /&gt;&amp;lt;username&gt;jeff.yuchang&amp;lt;/username&gt;&lt;br /&gt;&amp;lt;/user&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;OK, now we've successfully built and deployed a restful service. If you are a TDD(Test Driven Development) person like me, I guess you would like to use the embedded servlet container in your unit test. &lt;br /&gt;&lt;br /&gt;&lt;u&gt;Unit Test (Embedded servlet container)&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;RESTEasy has a out-of-box integration with &lt;a href="http://tjws.sourceforge.net/"&gt;Tiny Java Web Server&lt;/a&gt; as the embedded servlet container. We are using the http client as our client in our unit tests.&lt;br /&gt;&lt;br /&gt;1.&lt;b&gt;Adding tjws-webserver and servlet 2.5&lt;/b&gt;&lt;br /&gt;We need to add the twjs webserver-1.3.3.jar and the servlet-2.5.jar in our pom.xml&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;  &amp;lt;dependency&gt;&lt;br /&gt;   &amp;lt;groupId&gt;tjws&amp;lt;/groupId&gt;&lt;br /&gt;   &amp;lt;artifactId&gt;webserver&amp;lt;/artifactId&gt;&lt;br /&gt;   &amp;lt;version&gt;1.3.3&amp;lt;/version&gt;&lt;br /&gt;   &amp;lt;scope&gt;test&amp;lt;/scope&gt;&lt;br /&gt;  &amp;lt;/dependency&gt;&lt;br /&gt;  &amp;lt;dependency&gt;&lt;br /&gt;   &amp;lt;groupId&gt;org.apache.geronimo.specs&amp;lt;/groupId&gt;&lt;br /&gt;   &amp;lt;artifactId&gt;geronimo-servlet_2.5_spec&amp;lt;/artifactId&gt;&lt;br /&gt;   &amp;lt;version&gt;1.2&amp;lt;/version&gt;&lt;br /&gt;   &amp;lt;scope&gt;test&amp;lt;/scope&gt;&lt;br /&gt;  &amp;lt;/dependency&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2.&lt;b&gt;Write a Base test to start the webserver&lt;/b&gt;&lt;br /&gt;I write a following base test, which takes care of starting and stopping servlet server.&lt;pre class="brush:java"&gt;&lt;br /&gt;public class BaseTest extends Assert{&lt;br /&gt; &lt;br /&gt; protected static TJWSEmbeddedJaxrsServer server;&lt;br /&gt; &lt;br /&gt; protected static ResteasyDeployment deployment;&lt;br /&gt; &lt;br /&gt; protected static int port = 8081;&lt;br /&gt; &lt;br /&gt; @BeforeClass&lt;br /&gt; public static void initialize() throws Exception{&lt;br /&gt;  server = new TJWSEmbeddedJaxrsServer();&lt;br /&gt;  deployment = new ResteasyDeployment();&lt;br /&gt;  server.setDeployment(deployment);&lt;br /&gt;  server.setPort(port);&lt;br /&gt;  server.start();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void addPerRequestResource(Class&amp;lt;?&gt; clazz) {&lt;br /&gt;  deployment.getRegistry().addPerRequestResource(clazz);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; @AfterClass&lt;br /&gt; public static void destroy() throws Exception{&lt;br /&gt;  if (server != null) {&lt;br /&gt;   server.stop();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3.&lt;b&gt;Write unit test by using http client&lt;/b&gt;&lt;br /&gt;And now, comes our unit test class.&lt;pre class="brush:java"&gt;&lt;br /&gt;public class UserServiceTest extends BaseTest {&lt;br /&gt;&lt;br /&gt; @Before&lt;br /&gt; public void setUp() throws Exception {&lt;br /&gt;    this.addPerRequestResource(UserServiceImpl.class);&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; @Test&lt;br /&gt; public void testGetUser() throws Exception {&lt;br /&gt;  URL url = new URL("http://localhost:8081/user/100");&lt;br /&gt;  HttpURLConnection connection = (HttpURLConnection)url.openConnection();&lt;br /&gt;  connection.setRequestMethod("GET");&lt;br /&gt; &lt;br /&gt;     BufferedReader reader = new BufferedReader(new&lt;br /&gt;               InputStreamReader(connection.getInputStream())); &lt;br /&gt;     String line = reader.readLine();&lt;br /&gt;        while (line != null)&lt;br /&gt;        {&lt;br /&gt;         System.out.println(line);&lt;br /&gt;         line = reader.readLine();&lt;br /&gt;        }&lt;br /&gt;  &lt;br /&gt;  connection.disconnect();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; @Test&lt;br /&gt; public void testCreateUser() throws Exception {&lt;br /&gt;  URL url = new URL("http://localhost:8081/user");&lt;br /&gt;  HttpURLConnection connection = (HttpURLConnection)url.openConnection();&lt;br /&gt;  connection.setRequestMethod("POST");&lt;br /&gt;  connection.setRequestProperty("Content-Type", "application/xml");&lt;br /&gt;  connection.setDoOutput(true);&lt;br /&gt;  connection.setInstanceFollowRedirects(false);&lt;br /&gt;  &lt;br /&gt;  StringBuffer sbuffer = new StringBuffer();&lt;br /&gt;  sbuffer.append("&amp;lt;user id=\"0\"&gt;");&lt;br /&gt;  sbuffer.append("   &amp;lt;username&gt;Test User&amp;lt;/username&gt;");&lt;br /&gt;  sbuffer.append("   &amp;lt;email&gt;test.user@test.com&amp;lt;/email&gt;");&lt;br /&gt;  sbuffer.append("&amp;lt;/user&gt;");&lt;br /&gt;  &lt;br /&gt;  OutputStream os = connection.getOutputStream();&lt;br /&gt;  os.write(sbuffer.toString().getBytes());&lt;br /&gt;  os.flush();&lt;br /&gt;  &lt;br /&gt;     assertEquals(HttpURLConnection.HTTP_CREATED, connection.getResponseCode());&lt;br /&gt;  connection.disconnect();  &lt;br /&gt; }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You should be able to run test cases either in IDE or simply do it by running maven surefire plugin. You could obtain &lt;a href="http://people.apache.org/~jeffyu/articles/artifacts/restful-blog.tar"&gt;the whole project as a tall bar from here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;[References]&lt;br /&gt;1. &lt;a href="http://jboss.org/file-access/default/members/resteasy/freezone/docs/1.1.GA/userguide/html_single/index.html"&gt;RESTEasy user guide&lt;/a&gt;.&lt;br /&gt;2. &lt;a href="http://jcp.org/en/jsr/detail?id=311"&gt;JAX RS 1.0 spec&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-625026525176723857?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/625026525176723857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=625026525176723857&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/625026525176723857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/625026525176723857'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/08/build-restful-service-with-resteasy.html' title='Build restful service with RESTEasy'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4953541814901266400</id><published>2009-07-24T16:38:00.014+08:00</published><updated>2009-07-24T18:25:54.902+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web Service'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>code against web service.</title><content type='html'>Have worked on the web service area since when I joined the IONA in 2007, specifically, from the time that I started working on the &lt;a href="http://cxf.apache.org/"&gt;Apache CXF project&lt;/a&gt;. Although I've been working on web service stuff about 3 years, I still thought it is not an easy job to code against web service. these days, some of my friends ask me about the web service, from concepts to its hello-world example. So I think it worths to do a blog entry for people to get started with web service projects.&lt;br /&gt;&lt;br /&gt;And then I remembered that &lt;a href="http://www.jroller.com/gmazza/"&gt;Glen&lt;/a&gt; has did a ton of great blog entries about web service stack.(CXF, Metro and even Aix2 lately), and all of them are very detail, step-to-step. So here we go, we pick some of Glen's blog entries to get you started on web service.&lt;br /&gt;&lt;br /&gt;It is better that you get some concepts like the WSDL, SOAP, XSD, and read the JAXWS spec if time is allowed, just get a rough idea on it is ok, before we code against web service.&lt;br /&gt;&lt;br /&gt;Firstly, let's see the&lt;a href="http://www.jroller.com/gmazza/entry/creating_a_wsdl_first_web1"&gt; Creating a WSDL-first web service with Apache CXF or GlassFish Metro&lt;/a&gt; entry, it is our 'hello world' example.&lt;br /&gt;&lt;br /&gt;Want to see the SOAP Message that was transferred on the wire? you have couple options for this. One is to use tools like &lt;a href="http://wso2.org/blog/saliya/3938"&gt;Apache TCP Monitor&lt;/a&gt; or &lt;a href="http://www.jroller.com/gmazza/entry/wireshark_usage_for_cxf"&gt;wireshark&lt;/a&gt;. Another option is to use the JAXWS handler(similar to interceptor) mechanism, which is a very important feature in the spec. See &lt;a href="http://www.jroller.com/gmazza/entry/adding_jax_ws_handlers_to"&gt;Glen's JAX-WS handler blog entry&lt;/a&gt; to try it out.&lt;br /&gt;&lt;br /&gt;So you saw the soap message on the wire, how can we do with the binary stuff, that is what MTOM is for, you can see &lt;a href="http://www.jroller.com/gmazza/entry/using_mtom_and_apache_fop"&gt;"Returning PDFs from Web Services using MTOM and Apache FOP" blog entry&lt;/a&gt; for its usage and detail.&lt;br /&gt;&lt;br /&gt;If you are a person who like the Test-Driven Development, then don't miss the '&lt;a href="http://www.jroller.com/gmazza/entry/writing_junit_test_cases_for"&gt;creating junit test case for web service&lt;/a&gt;' blog entry.&lt;br /&gt;&lt;br /&gt;Security is a big concern in the enterprise development, so that is what ws-security spec for. firstly, you could read the '&lt;a href="http://www.jroller.com/gmazza/entry/setting_up_ssl_and_basic"&gt;Using SSL and Basic Authentication with web services (Tomcat or WebLogic)&lt;/a&gt;' for its basic usage, and then go on reading the &lt;a href="http://www.jroller.com/gmazza/entry/implementing_ws_security_using_usernametokens"&gt;username token profile blog entry&lt;/a&gt;, &lt;a href="http://www.jroller.com/gmazza/entry/implementing_ws_security_with_pki"&gt;Implementing WS-Security with public key certificates for Metro-based web services&lt;/a&gt;. Also can read the ' &lt;a href="http://www.jroller.com/gmazza/entry/using_the_opensaml_library_in"&gt;Using OpenSAML in JAX-WS Handlers&lt;/a&gt;' if you are interested in the SAML token profile in ws-security.&lt;br /&gt;&lt;br /&gt;I think that should be enough for you to get it started, you can explore more on the &lt;a href="http://www.jroller.com/gmazza/"&gt;Glen's website&lt;/a&gt;, you would find more entries about web service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4953541814901266400?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4953541814901266400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4953541814901266400&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4953541814901266400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4953541814901266400'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/code-against-web-service.html' title='code against web service.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6465199240144872692</id><published>2009-07-21T22:06:00.004+08:00</published><updated>2009-07-22T00:41:47.625+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBossESB'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='jBPM'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><category scheme='http://www.blogger.com/atom/ns#' term='Drools'/><title type='text'>Updates on JBoss ESB.</title><content type='html'>The JBoss ESB team rolled out &lt;a href="http://www.jboss.org/index.html?module=bb&amp;amp;op=viewtopic&amp;amp;t=158696"&gt;its 4.6 release&lt;/a&gt; yesterday, one of its main feature that it is introduced is to support the JBoss AS5, so go and grab it to try it out.&lt;br /&gt;&lt;br /&gt;Also spotted that &lt;a href="http://swqetesting.blogspot.com/"&gt;Len&lt;/a&gt; has composed three great posts on JBoss SOA-P, it applies also to the JBoss ESB.&lt;br /&gt;1. &lt;a href="http://jboss-soa-p.blogspot.com/2009/07/soa-platform-gateways-and-notifiers.html"&gt;SOA Platform Gateways and Notifiers&lt;/a&gt;. This talks about the Gateway, ESB aware message, ESB non-aware message, Notifier concepts that from the JBoss ESB.&lt;br /&gt;2. &lt;a href="http://jboss-soa-p.blogspot.com/2009/07/when-content-knows-way-content-based.html"&gt;When The Content knows the way&lt;/a&gt;. This talks about the JBoss ESB integrates with Drools.&lt;br /&gt;3. &lt;a href="http://jboss-soa-p.blogspot.com/2009/06/hanging-together-on-soa-platform.html"&gt;Hanging Together on the SOA Platform - Introduction to the ESB-jBPM integration&lt;/a&gt;. This entry talks about the ESB and jBPM integration.&lt;br /&gt;&lt;br /&gt;One thing that I must say is that these three entries are very well written, easy to understand. Very good work, Len. ;-)&lt;br /&gt;&lt;br /&gt;If you want to read more Len's posts, then follow the &lt;a href="http://jboss-soa-p.blogspot.com/"&gt;soa-p's blog&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6465199240144872692?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6465199240144872692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6465199240144872692&amp;isPopup=true' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6465199240144872692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6465199240144872692'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/updates-on-jboss-esb.html' title='Updates on JBoss ESB.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1846988186397747820</id><published>2009-07-19T14:45:00.015+08:00</published><updated>2009-07-29T13:13:14.722+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='jBPM'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Getting Started with jBPM 4.0 (Part IV)</title><content type='html'>As said in &lt;a href="http://jeffyuchang.blogspot.com/2009/07/getting-started-with-jbpm-40-part-iii.html"&gt;part III&lt;/a&gt;, we will revise our example, to create the task form, and then use the jbpm console to take or complete the task.&lt;br /&gt;&lt;br /&gt;Firstly, because there was a minor issue related to this feature, which was reported &lt;a href="https://jira.jboss.org/jira/browse/JBPM-2423"&gt;here in the jBPM jira&lt;/a&gt;, we will use the 'form' attribute in the jpdl file.&lt;br /&gt;&lt;br /&gt;1.&lt;u&gt;Add the task form template&lt;/u&gt;&lt;br /&gt;Here, we will create a freemarker template file, named review.ftl. the files content is as following:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;html&gt;&lt;br /&gt;&amp;lt;body&gt;&lt;br /&gt;&amp;lt;h2&gt;Please review the request&lt;br /&gt;&amp;lt;form action="${form.action}" method="POST" enctype="multipart/form-data"&gt;&lt;br /&gt;&amp;lt;#list outcome.values as transition&gt;&lt;br /&gt;&amp;lt;input type="submit" name="outcome" value="${transition}"&gt;&lt;br /&gt;&amp;lt;/#list&gt;&lt;br /&gt;&amp;lt;/form&gt;&lt;br /&gt;&amp;lt;/body&gt;&lt;br /&gt;&amp;lt;/html&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2.&lt;u&gt;Add the form attribute in task node&lt;/u&gt;&lt;br /&gt;As we said earlier, due to the &lt;a href="https://jira.jboss.org/jira/browse/JBPM-2423"&gt;JBPM-2423 issue&lt;/a&gt; in jBPM 4.0 GA, we need to update our jpdl to associate our task form template. the updated section is as following.&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;task assignee="alex" g="277,235,92,52" name="review" &lt;span style="color: rgb(255, 0, 0);"&gt;form="review.ftl"&lt;/span&gt;&gt;&lt;br /&gt;&amp;lt;transition g="-73,-25" name="approved" to="audit"/&gt;&lt;br /&gt;&amp;lt;/task&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;3. &lt;u&gt; Update the build.xml, to include the .ftl file in .bar archive&lt;/u&gt;&lt;br /&gt;The last step would be to update our build.xml, to include the ftl template file, and also include the png file for the diagram show usage in our jbpm console.&lt;br /&gt;The updated bar package built script is:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;target name="bar" depends="init"&gt;&lt;br /&gt;&amp;lt;jar destfile="${basedir}/target/helloworld.bar"&gt;&lt;br /&gt;  &amp;lt;fileset dir="${basedir}/src/main/resources"&gt;&lt;br /&gt;        &amp;lt;include name="*.jpdl.xml" /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;      &amp;lt;include name="*.ftl" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;    &amp;lt;include name="*.png" /&gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;/fileset&gt;&lt;br /&gt;   &amp;lt;/jar&gt;&lt;br /&gt;&amp;lt;/target&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That is it, now you can re-deploy it into the jBPM server, &lt;a href="http://jeffyuchang.blogspot.com/2009/07/getting-started-with-jbpm-40-part-iii.html"&gt;like we said in the part3&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Task Form in jBPM console&lt;/u&gt;&lt;br /&gt;well, after we started the process instance, let's see the diagram and the task form in its console UI.&lt;br /&gt;&lt;br /&gt;On the process instance tab, click the 'diagram' button in the instance details page, you would see page as following picture.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4KnaH_XIr1w/SmLKP4ue_YI/AAAAAAAABgY/MJASUfMZ3N0/s1600-h/diagram.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 158px;" src="http://2.bp.blogspot.com/_4KnaH_XIr1w/SmLKP4ue_YI/AAAAAAAABgY/MJASUfMZ3N0/s400/diagram.gif" alt="" id="BLOGGER_PHOTO_ID_5360068880798514562" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Go to the task list -&gt; Personal tasks, you would see there is a task, the name is called "review", select the task and click the 'view' button, it would pop up the task form interface as following picture.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4KnaH_XIr1w/SmLKQM21hZI/AAAAAAAABgg/5EL0R9y9sRw/s1600-h/taskform.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 231px;" src="http://2.bp.blogspot.com/_4KnaH_XIr1w/SmLKQM21hZI/AAAAAAAABgg/5EL0R9y9sRw/s400/taskform.gif" alt="" id="BLOGGER_PHOTO_ID_5360068886202254738" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Once you click the 'approved' button, the task is completed, and the whole process goes to the 'audit' state as we've defined in the jpdl file.&lt;br /&gt;&lt;br /&gt;So, that is all for the task form example. If you want to know more about the template, like syntax, you can refer to the &lt;a href="http://freemarker.sourceforge.net/"&gt;freemarker webiste&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One thing interesting is that there is a console-server, which is the jbpm console talk to, the console server is responsible for exposing the jBPM service as a RESTful services. You can go to "http://localhost:8080/gwt-console-server/rs/server/resources" to see all available resources. we won't go detail in this entry, this is an interesting topic that we will cover in the future blog entry.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Until now, this 《Getting Started with jBPM 4.0》series is finished, you can download the &lt;a href="http://people.apache.org/%7Ejeffyu/articles/artifacts/jbpm-helloworld.tar"&gt;jbpm-helloworld example as a tar ball from here&lt;/a&gt;. Its aim is to help you get started, if you want to know more about jBPM 4.0, the &lt;a href="http://docs.jboss.com/jbpm/v4.0/userguide/html_single/"&gt;userguide&lt;/a&gt; and &lt;a href="http://docs.jboss.com/jbpm/v4.0/devguide/html_single/"&gt;dev guide&lt;/a&gt; are very good documents, and you also shouldn't miss &lt;a href="http://www.jboss.org/index.html?module=bb&amp;amp;op=viewforum&amp;amp;f=217"&gt;the jbpm user forum&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1846988186397747820?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1846988186397747820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1846988186397747820&amp;isPopup=true' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1846988186397747820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1846988186397747820'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/getting-started-with-jbpm-40-part-iv.html' title='Getting Started with jBPM 4.0 (Part IV)'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_4KnaH_XIr1w/SmLKP4ue_YI/AAAAAAAABgY/MJASUfMZ3N0/s72-c/diagram.gif' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3044088116844692520</id><published>2009-07-14T11:28:00.020+08:00</published><updated>2009-07-15T00:29:44.743+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>浅谈ws-security: 加密,签名,证书等</title><content type='html'>我们这个贴子所谈的,可以说是一个普遍的Security问题,不过因为我在做SOA的东西,所以就想从web service security的角度来探讨一下.必须声明的是,我并不是在解读 &lt;a href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss"&gt;ws-security&lt;/a&gt; 规范, 从某种意义上来说,是在学习Java Security.&lt;br /&gt;&lt;br /&gt;从web service的应用场景来说, 要从endpoint A 发送 SOAP message 到 endpoint B. 一般情况下, 如果我们要保证这个soap message信息的安全,主要会从以下三个方面来考虑,阐述.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;保密性(Confidentiality)&lt;/li&gt;&lt;li&gt;完整性(Integrity)&lt;/li&gt;&lt;li&gt;真实性(Authenticity)&lt;/li&gt;&lt;/ol&gt;我们接下来挨个来看下,是怎么满足这三个需求的,以及在JDK中,分别提供了什么样的API来于之对应.&lt;br /&gt;&lt;br /&gt;1.&lt;u&gt; 保密性(Confidentiality)&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;从大的分类来看,我们有两大种加密技术,分别是对称加密(symmetric encryption)和非对称加密(asymmetric encryption).&lt;br /&gt;&lt;br /&gt;1.1 &lt;u&gt;对称加密(symmetric encryption)&lt;/u&gt;&lt;br /&gt;对称加密是一个比较早的一种加密方式.比如说Alice要发送一个消息跟Bob,那么他们之前就应该说定了一个secret key,然后Alice把信息用这个secret key进行加密. 当信息到达Bob的时候, Bob再利用这个secret key来把它解密.&lt;br /&gt;这种加密方式,可以是对每个bit进行加密,也可以是对block(chunk of bit, 比如64-bit)进行加密. 如果在是选择block加密的话,就得有一个补足(Padding)的概念,就比如说不够64-bit,你用0或者其他的来补足成一个block.&lt;br /&gt;在Java中, Cipher类是负责加密,解密的.在对称加密中,需要以下三个属性.&lt;br /&gt;1) 加密模式, 比如(ECB -Encryption Code Book, CBC, CFB, OFB, PCBC)&lt;br /&gt;2) 加密算法, 比如(DES- Data Encryption Standard, TripleDES, AES, RC2, RC4, RC5, Blowfish, PBE)&lt;br /&gt;3) 补足方式, 比如(No padding, PKCS5, OAEP, SSL3)&lt;br /&gt;&lt;br /&gt;我们下面这个例子就是使用Java的Cipher类来加密.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;KeyGenerator keygen = KeyGenerator.getInstance("DES");&lt;br /&gt;keygen.init(56);&lt;br /&gt;SecretKey key = keygen.generateKey();&lt;br /&gt;&lt;br /&gt;Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");&lt;br /&gt;cipher.init(Cipher.ENCRYPT_MODE, key);&lt;br /&gt;&lt;br /&gt;byte[] cipherText = cipher.doFinal("This is clear text".getBytes("UTF-8"));&lt;br /&gt;&lt;br /&gt;cipher.init(Cipher.DECRYPT_MODE, key);&lt;br /&gt;byte[] clearText = cipher.doFinal(cipherText);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;先是生成一个56的DES的加密钥匙, 然后采用DES算法, ECB加密模式, PKCS5Padding补足方式来加密.&lt;br /&gt;&lt;br /&gt;1.2 &lt;u&gt;非对称加密(Asymmetric Encryption)&lt;/u&gt;&lt;br /&gt;对称加密存在的一个主要问题在于怎么安全的配发这个密钥给Alice和Bob呢?所以,我们后来引入了这个非对称加密,可以说现在这个是一个很普遍的加密方法.&lt;br /&gt;非对称加密主要是他有两把钥匙, 公钥(Public Key)和私钥(Private Key),这两把钥匙是配对的. 一样的情况, Alice想发送信息给Bob, 那么流程就如下:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Alice使用Bob的公钥加密信息 -&gt; 加密过的信息 -&gt;Bob用他自己的私钥解密.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;这种情况下,大家只需要把公钥放在一个信任的机构(CA,例如Verisign),把私钥保留在自己手上,那么就解决了对称加密中密钥的配发问题.当然了,这个非对称加密的伟大之处还在于如果你没有私钥,至少在你的有生之年是无法破解的.&lt;br /&gt;非对称加密的算法主要有两种: RSA 和 Diffie-Hellman. RSA是最为广泛使用的一种加密算法.&lt;br /&gt;相对应的,我们就得使用keypair来加密解密,代码如下:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");&lt;br /&gt;keyGen.initialize(1024);&lt;br /&gt;KeyPair keypair = keyGen.generateKeyPair();&lt;br /&gt;&lt;br /&gt;Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");&lt;br /&gt;cipher.init(Cipher.ENCRYPT_MODE, keypair.getPublic());&lt;br /&gt;&lt;br /&gt;byte[] cipherText = cipher.doFinal("This is clear text".getBytes("UTF-8"));&lt;br /&gt;&lt;br /&gt;cipher.init(Cipher.DECRYPT_MODE, keypair.getPrivate());&lt;br /&gt;byte[] clearText = cipher.doFinal(cipherText);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;不同的是,我们用公钥加密,然后用私钥来解密. 当然了,我们也可以用私钥加密,然后公钥来解密,这在我们后面的数字签名中会用到.&lt;br /&gt;&lt;br /&gt;2. &lt;u&gt;完整性(Integrity)&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;我们可以用加密的手段对信息进行了加密,那么保证这个信息的明文不会被其他人看到,但是我们怎么来保证说这个发过来的信息就是完整的呢?&lt;br /&gt;那么我们这里就因为一个叫信息摘要(Message Digest)的概念,所谓的信息摘要就是说用一个摘要算法,把信息生成一串字符,可以算是信息的足迹(fingerprint of the message). 这种算法是一个单方向的,也就是说,从生成的字符想倒推到原来的这个信息,那几乎是不可能的.这个算法的另外一个特点是,只要你对信息做一个小小的改动,那么生成的字符串差别就很明显.&lt;br /&gt;常见的消息摘要(Message-digest)算法有: MD2, MD5 (128位的算法), SHA-1 (160位的算法)&lt;br /&gt;在Java中,MessageDigest类来负责信息摘要,使用大致如下:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;MessageDigest messageDigest = MessageDigest.getInstance("MD5");&lt;br /&gt;messageDigest.update("TestMessage".getBytes("UTF-8"));&lt;br /&gt;System.out.println(new String(messageDigest.digest(), "UTF-8"));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;u&gt;真实性(Authenticity)&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;上面我们解决了保密性和完整性,那我们怎么来保证Bob收到的这个信息就是Alice发的吗?有可能是Eva借用Alice的名字,拿到Bob的公钥发的.&lt;br /&gt;基于这个考虑,我们就引入了一个数字签名(Digital Signature)的概念.数字签名就是在你发送信息的时候,用你的私钥进行加密,实际应用中,会对信息摘要进行数字签名,那么当Bob收到这个被数字签名过的信息摘要时,用Alice的公钥去解密,就可以确定这个消息是来自于Alice.&lt;br /&gt;数字签名的算法有两种: RSA, DSA(Digital Signature Algorithm). 注意, RSA算法,既可用于加密,也可以用于数字签名. 但是DSA只可用于数字签名.&lt;br /&gt;JDK支持以下的组合, MD2/RSA, MD5/RSA, SHA1/DSA, SHA1/RSA.&lt;br /&gt;下面我们直接看JDK中Siganiture类来签名的使用.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");&lt;br /&gt;keyGen.initialize(1024);&lt;br /&gt;KeyPair keypair = keyGen.generateKeyPair();&lt;br /&gt;&lt;br /&gt;Signature sig = Signature.getInstance("MD5WithRSA");&lt;br /&gt;sig.initSign(keypair.getPrivate()); &lt;br /&gt;sig.update("This is message".getBytes("UTF-8"));&lt;br /&gt;&lt;br /&gt;byte[] signature = sig.sign();&lt;br /&gt;&lt;br /&gt;//Verify the signature&lt;br /&gt;sig.initVerify(keypair.getPublic());&lt;br /&gt;sig.update("This is message".getBytes("UTF-8"));&lt;br /&gt;if (sig.verify(signature)) {&lt;br /&gt;  System.out.println("Signature verified.");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;到目前为止,我们介绍了加密,信息完整,数字签名这三个概念,应该说可以是完成了,你都懂了.&lt;br /&gt;&lt;br /&gt;但是,等等,你是不是在经常听到说证书,X.509, keytool, keystore等等的概念呢?&lt;br /&gt;下面,我们再来依次看看这几个概念.&lt;br /&gt;&lt;br /&gt;4. &lt;u&gt;证书(certificates) &amp;amp; X.509&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;之前我们说,在这种非对称加密算法中,我们一般会把公钥放在一个另外一个机构,这个机构专门负责来保管你的公钥,而且这个机构还负责核实你的真实性. 那么他一旦核实你后,就会创建一个东西,这个东西包含了你的公钥,你的个人信息(Identity),然后再用这个机构的私钥进行数字签名. 我们管这个东西就叫数字证书. 我们管这样的机构叫做CA( Certificate Authority)&lt;br /&gt;X.509是一种存储证书的标准,我们通常直接叫X.509证书.&lt;br /&gt;&lt;br /&gt;5. &lt;u&gt;keytool, keystore&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;keystore是用来存放钥匙(包括公钥,私钥),证书的容器. keystore是一个以.keystore为后缀名的文件.在keystore里面的钥匙和证书可以有名字,叫做alias. 而且他们各自可以有密码保护.&lt;br /&gt;&lt;br /&gt;JDK自带的keytool是用来创建keystore以及key的工具,下面我们来看几个常用的命令.&lt;br /&gt;&lt;br /&gt;1) 创建keys (注意不能换行).&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;keytool -genkey -alias serverkey -keypass serverpass -keyalg RSA -sigalg SHA1withRSA -keystore server.keystore -storepass nosecret&lt;br /&gt;&lt;br /&gt;keytool -genkey -alias clientkey -keypass clientpass -keyalg RSA -sigalg SHA1withRSA -keystore client.keystore -storepass nosecret&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;2)导出证书&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;keytool -export -alias serverkey -keystore server.keystore -storepass nosecret -file servercert.cer&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;3)导入证书&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;keytool -import -alias serverkey -keystore client.keystore -storepass nosecret -file servercert.cer&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;6. &lt;u&gt;keystore, truststore的区别&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;在跟web service 打交道,或者做测试的时候,你会经常听到trust store这个词,他其实就是一个CA,他是专门存放public key的; keystore是既存放public key,也存放private key的.&lt;a href="http://www.jboss.org/community/index.html?module=bb&amp;op=viewtopic&amp;t=94406"&gt;&lt;br /&gt;这个贴子上&lt;/a&gt;, Jason详细的解释了在ws security中,keystore和truststore的配置问题.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[References]&lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/edu/j-dw-javasec1-i.html"&gt;Java security Part 1, Crypto basics&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/edu/ws-dw-ws-understand-web-services4.html"&gt;Understanding WS-Security&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/webservices/library/j-jws5/index.html"&gt;WS-Security signing and encryption&lt;/a&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/keytool.html"&gt;Keytool documentation&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3044088116844692520?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3044088116844692520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3044088116844692520&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3044088116844692520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3044088116844692520'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/ws-security.html' title='浅谈ws-security: 加密,签名,证书等'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1924802158090638637</id><published>2009-07-12T14:12:00.011+08:00</published><updated>2009-07-29T13:04:04.215+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='jBPM'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Getting Started with jBPM 4.0 (Part III)</title><content type='html'>In this entry, we are going to deploy the built process definition into jBPM server. Basically, we need to deploy two artifacts, one is the process definition file, which is archived as .bar file, the other is the classes file that will be needed.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Deploy the process definition into jBPM server &lt;/u&gt;&lt;br /&gt;&lt;br /&gt;jBPM offer its ant jBPM deploy task out of box, the example also uses this way to deploy the process definiton, the other way to do it is to move this .bar file to the jboss deploy folder directly, it will be pick up and deployed into db as well, thanks to the jBPM deployer that leverage JBoss AS 5  deployer framework.&lt;br /&gt;&lt;br /&gt;In order to use both these ways, we will add the build.xml to help us do the bar, jar build work.&lt;br /&gt;&lt;br /&gt;below is the code snippet from the build.xml.&lt;br /&gt;&lt;pre class="brush:xml"&gt; &amp;lt;target name="jar" depends="init"&gt;&lt;br /&gt;&amp;lt;mkdir dir="${basedir}/target/classes" /&gt;&lt;br /&gt;&amp;lt;javac srcdir="${basedir}/src/main/java"&lt;br /&gt;destdir="${basedir}/target/classes"&lt;br /&gt;classpathref="classpath.lib" /&gt;&lt;br /&gt;&amp;lt;jar destfile="${basedir}/target/helloworld.jar" &gt;&lt;br /&gt;&amp;lt;fileset dir="${basedir}/target/classes"&gt;&lt;br /&gt;&amp;lt;include name="**/*.class" /&gt;&lt;br /&gt;&amp;lt;/fileset&gt;&lt;br /&gt;&amp;lt;/jar&gt;&lt;br /&gt;&amp;lt;/target&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;target name="bar" depends="init"&gt;&lt;br /&gt;&amp;lt;jar destfile="${basedir}/target/helloworld.bar"&gt;&lt;br /&gt;&amp;lt;fileset dir="${basedir}/src/main/resources"&gt;&lt;br /&gt;&amp;lt;include name="*.jpdl.xml"/&gt;&lt;br /&gt;&amp;lt;/fileset&gt;&lt;br /&gt;&amp;lt;/jar&gt;&lt;br /&gt;&amp;lt;/target&gt;&lt;br /&gt;&lt;/pre&gt; we will look into both two deployment ways, one is using ant task, the other is using jBPM deployer, the underlie is the same, it is using the RepositoryService to do the deployment work.&lt;br /&gt;&lt;br /&gt;1. using jBPM deployer.&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;target name="deploy" description="deploys the business archives into jboss"&lt;br /&gt;    depends=" jar,bar"&gt;&lt;br /&gt;&amp;lt;mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs"/&gt;&lt;br /&gt;&amp;lt;copy file="${basedir}/target/helloworld.bar"&lt;br /&gt;todir="${jboss.server.config.dir}/deploy/jbpm/userlibs"&lt;br /&gt;overwrite="true" /&gt;&lt;br /&gt;&amp;lt;copy file="${basedir}/target/helloworld.jar"&lt;br /&gt;todir="${jboss.server.config.dir}/deploy/jbpm/userlibs"&lt;br /&gt;overwrite="true" /&gt;&lt;br /&gt;&amp;lt;/target&gt;&lt;span style="font-family:sans-serif;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2. Use the jBPM deployer ANT task.&lt;br /&gt;&lt;pre class="brush:xml"&gt;  &amp;lt;target name="jbpm.deploy"&lt;br /&gt;description="deploys the business archives"&lt;br /&gt;depends=" jar, bar"&gt;&lt;br /&gt;&amp;lt;copy file="${jbpm.home}/db/hibernate.cfg/${database}.hibernate.cfg.xml"&lt;br /&gt;tofile="${basedir}/target/classes/jbpm.hibernate.cfg.xml"&lt;br /&gt;overwrite="true"&gt;&lt;br /&gt;&amp;lt;filterset filtersfile="${jbpm.home}/db/jdbc/${database}.properties" /&gt;&lt;br /&gt;&amp;lt;/copy&gt;&lt;br /&gt;&amp;lt;copy file="${basedir}/src/test/resources/jbpm.cfg.xml"&lt;br /&gt;   tofile="${basedir}/target/classes/jbpm.cfg.xml"&lt;br /&gt;/&gt;&lt;br /&gt;&amp;lt;taskdef name="jbpm-deploy"&lt;br /&gt;  classname="org.jbpm.pvm.internal.ant.JbpmDeployTask"&lt;br /&gt;classpathref="classpath.lib" /&gt;&lt;br /&gt;&amp;lt;jbpm-deploy file="${basedir}/target/helloworld.bar" /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" /&gt;&lt;br /&gt;&amp;lt;copy file="${basedir}/target/helloworld.jar"&lt;br /&gt;todir="${jboss.server.config.dir}/deploy/jbpm/userlibs"&lt;br /&gt;overwrite="true" /&gt;&lt;br /&gt;&amp;lt;/target&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Note&lt;/span&gt;: The jBPM server needs to be up and running, and then you deploy the process archive into server through either way.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;jBPM console tour &lt;/u&gt;&lt;br /&gt;&lt;br /&gt;After we deployed our process, we will use the console to see the process information etc.&lt;br /&gt;&lt;br /&gt;Let's login http://localhost:8080/jbpm-console, with the 'alex/password' combination, it will direct us to the console homepage, as following page.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4KnaH_XIr1w/Slm2DaKg6AI/AAAAAAAABdU/KtDUwDve2_s/s1600-h/console-homepage.gif"&gt;&lt;img style="cursor: pointer; width: 382px; height: 400px;" src="http://1.bp.blogspot.com/_4KnaH_XIr1w/Slm2DaKg6AI/AAAAAAAABdU/KtDUwDve2_s/s400/console-homepage.gif" alt="" id="BLOGGER_PHOTO_ID_5357513401413199874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click the 'Runtime' tab from the left menu panel, we can see the 'Deployments' and 'Jobs' links. Click the 'Deployments', we can see the helloworld.bar that we just deployed.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4KnaH_XIr1w/Slm2Dm9qqtI/AAAAAAAABdc/5nFKGUuUIow/s1600-h/console-deployments.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 149px;" src="http://4.bp.blogspot.com/_4KnaH_XIr1w/Slm2Dm9qqtI/AAAAAAAABdc/5nFKGUuUIow/s400/console-deployments.gif" alt="" id="BLOGGER_PHOTO_ID_5357513404848974546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click the 'Processes' tab from the left menu panel, we can see the 'Definition List' link, click it, it will show us all of the process definitions as following.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4KnaH_XIr1w/Slm2EDhZ_-I/AAAAAAAABdk/6BkfwJopjls/s1600-h/console-process.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 202px;" src="http://1.bp.blogspot.com/_4KnaH_XIr1w/Slm2EDhZ_-I/AAAAAAAABdk/6BkfwJopjls/s400/console-process.gif" alt="" id="BLOGGER_PHOTO_ID_5357513412515069922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click the 'Process Instances' tab from the right area, click the 'start' button, which will start the process definition, its instace detail looks like:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4KnaH_XIr1w/Slm2FM7kRRI/AAAAAAAABd0/hj25y5UcxuQ/s1600-h/console-start-process-detail.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 51px;" src="http://4.bp.blogspot.com/_4KnaH_XIr1w/Slm2FM7kRRI/AAAAAAAABd0/hj25y5UcxuQ/s400/console-start-process-detail.gif" alt="" id="BLOGGER_PHOTO_ID_5357513432220583186" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also, look on the server's console, you would notice that following lines:&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;17:37:44,566 INFO  [STDOUT] --------------------&lt;br /&gt;17:37:44,567 INFO  [STDOUT] Made a request.....&lt;br /&gt;17:37:44,567 INFO  [STDOUT] ---------------------&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So, it means, the started process instance already gone through the java node, and right now is on the 'review' activity node. Remembered that we assigned this task to 'alex' in the process definition, and we login the console by using alex, so we should be able to see this task in the task tab from left panel.&lt;br /&gt;&lt;br /&gt;Click the 'Tasks' -&gt; 'Task Lists' -&gt; 'Personal Tasks', you would see the page as following.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_4KnaH_XIr1w/Slm2SMzInKI/AAAAAAAABd8/9V8sVzqwQDE/s1600-h/console-task.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 50px;" src="http://4.bp.blogspot.com/_4KnaH_XIr1w/Slm2SMzInKI/AAAAAAAABd8/9V8sVzqwQDE/s400/console-task.gif" alt="" id="BLOGGER_PHOTO_ID_5357513655523515554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can view or release this task. Currently, if you click the 'view' button, it will tell you that 'The task doesn't provide a UI'. we haven't added the UI page for this task yet, which we will talk about it in the next entry.&lt;br /&gt;&lt;br /&gt;Because this entry is a bit lengthy, I think it is better that I make a summary here. Basically we talked about two ways to deploy the process and its classes into jBPM server, once you've deployed it, you should be able to see as much as information from the jbpm console, which is very fancy, built based on GWT.&lt;br /&gt;&lt;br /&gt;In the next entry, I will try to talk about the task form in the console, stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1924802158090638637?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1924802158090638637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1924802158090638637&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1924802158090638637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1924802158090638637'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/getting-started-with-jbpm-40-part-iii.html' title='Getting Started with jBPM 4.0 (Part III)'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_4KnaH_XIr1w/Slm2DaKg6AI/AAAAAAAABdU/KtDUwDve2_s/s72-c/console-homepage.gif' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7070338884064611421</id><published>2009-07-12T08:40:00.013+08:00</published><updated>2009-07-29T13:08:07.357+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='jBPM'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Getting Started with jBPM 4.0 (Part II)</title><content type='html'>In this blog entry, we are going to use the eclipse GUI to build a helloworld process, and then write a unit test to verify the process.&lt;br /&gt;&lt;br /&gt;Firstly, I assumed that you've successfully installed the eclipse GUI, if you haven't done so, please refer to the &lt;a href="http://jeffyuchang.blogspot.com/2009/07/getting-started-with-jbpm-40.html"&gt;first Part blog entry&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;u&gt; Create Project and Process Definition&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Then, we will create a java project, I used the following project layout(maven way).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4KnaH_XIr1w/Slk2VVs8dpI/AAAAAAAABdA/TBRLd9jgQhU/s400/jbpm-helloworld-layout.gif"&gt;&lt;img style="cursor: pointer; width: 363px; height: 272px;" src="http://1.bp.blogspot.com/_4KnaH_XIr1w/Slk2VVs8dpI/AAAAAAAABdA/TBRLd9jgQhU/s400/jbpm-helloworld-layout.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;we will put the process definition file into the main/resource folder, and the test case &amp;amp; its resources in the src/test folder.&lt;br /&gt;&lt;br /&gt;In this helloworld process, we will do the following process scenario.&lt;br /&gt;we will have a 'java node', to make a request, and then we add the 'review task node', and then if it is 'approved', it will lead to the 'audit state node'.  Of course, we will include the 'start' and the 'end' node in this process, so the finished process image would be like:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4KnaH_XIr1w/Slk4wY31XeI/AAAAAAAABdI/5wE3hVXOfuo/s1600-h/jbpm-helloworld-process.gif"&gt;&lt;img style="cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_4KnaH_XIr1w/Slk4wY31XeI/AAAAAAAABdI/5wE3hVXOfuo/s400/jbpm-helloworld-process.gif" alt="" id="BLOGGER_PHOTO_ID_5357375635695427042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In this process definition, we are using a java node to be the 'request' node, its java code as following:&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;package org.jbpm.helloworld;&lt;br /&gt;&lt;br /&gt;public class Println {&lt;br /&gt;&lt;br /&gt;public void request() {&lt;br /&gt;    System.out.println("--------------------");&lt;br /&gt;    System.out.println("Made a request.....");&lt;br /&gt;    System.out.println("---------------------");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The process definition xml is as following:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;process name="helloworld" xmlns="http://jbpm.org/4.0/jpdl"&gt;&lt;br /&gt;&amp;lt;start  name="start"&gt;&lt;br /&gt;  &amp;lt;transition  name="to request" to="request"/&gt;&lt;br /&gt;&amp;lt;/start&gt;&lt;br /&gt;&amp;lt;end  name="end"/&gt;&lt;br /&gt;&amp;lt;java class="org.jbpm.helloworld.Println"  method="request" name="request"&gt;&lt;br /&gt;  &amp;lt;transition  name="to review" to="review"/&gt;&lt;br /&gt;&amp;lt;/java&gt;&lt;br /&gt;&amp;lt;task assignee="alex"  name="review"&gt;&lt;br /&gt;  &amp;lt;transition  name="approved" to="audit"/&gt;&lt;br /&gt;&amp;lt;/task&gt;&lt;br /&gt;&amp;lt;state  name="audit"&gt;&lt;br /&gt;  &amp;lt;transition  name="to end" to="end"/&gt;&lt;br /&gt;&amp;lt;/state&gt;&lt;br /&gt;&amp;lt;/process&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The xml itself is very easy to understand, you might notice that 'g' attribute in your process definition file, that is only used by the Eclipse GUI.&lt;br /&gt;&lt;br /&gt;&lt;u&gt; Verify the process &lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Once we've finished the process, we want to verify whether it is as same as we expected, with the jBPM 4.0, it is very easy for us to verify it, without deploying it into the container.&lt;br /&gt;&lt;br /&gt;With the following 2 steps, we can easily test the process by using API.&lt;br /&gt;Because the jbpm.jar doesn't include the jbpm.hibernte.cfg.xml and jbpm.cfg.xml, we need to configure it by ourselves for the test purpose. (However, The deployed jbpm in JBoss container has these two files by default)&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Add the jbpm.hibernate.cfg.xml and jbpm.cfg.xml.&lt;/li&gt;&lt;br /&gt;we put these two files into the src/test/resource folder.&lt;br /&gt;the jbpm.hibernate.cfg.xml would be like as following:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;hibernate-configuration&gt;&lt;br /&gt; &amp;lt;session-factory&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.HSQLDialect&lt;/property&gt;&lt;br /&gt;    &amp;lt;property name="hibernate.connection.driver_class"&gt;org.hsqldb.jdbcDriver&lt;/property&gt;&lt;br /&gt;    &amp;lt;property name="hibernate.connection.url"&gt;jdbc:hsqldb:mem:.&lt;/property&gt;&lt;br /&gt;    &amp;lt;property name="hibernate.connection.username"&gt;sa&lt;/property&gt;&lt;br /&gt;    &amp;lt;property name="hibernate.connection.password"&gt;&lt;property&gt;&lt;br /&gt;    &amp;lt;property name="hibernate.hbm2ddl.auto"&gt;create-drop&lt;/property&gt;&lt;br /&gt;    &amp;lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;&lt;br /&gt;   &lt;br /&gt;    &amp;lt;mapping resource="jbpm.repository.hbm.xml" /&gt;&lt;br /&gt;    &amp;lt;mapping resource="jbpm.execution.hbm.xml" /&gt;&lt;br /&gt;    &amp;lt;mapping resource="jbpm.history.hbm.xml" /&gt;&lt;br /&gt;    &amp;lt;mapping resource="jbpm.task.hbm.xml" /&gt;&lt;br /&gt;    &amp;lt;mapping resource="jbpm.identity.hbm.xml" /&gt;&lt;br /&gt;   &lt;br /&gt; &amp;lt;/session-factory&gt;&lt;br /&gt;&amp;lt;/hibernate-configuration&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and here it is the jbpm.cfg.xml:&lt;br /&gt;&lt;pre class="brush:xml"&gt;&lt;br /&gt;&amp;lt;jbpm-configuration&gt;&lt;br /&gt; &amp;lt;import resource="jbpm.default.cfg.xml" /&gt;&lt;br /&gt; &amp;lt;import resource="jbpm.tx.hibernate.cfg.xml" /&gt;&lt;br /&gt; &amp;lt;import resource="jbpm.jpdl.cfg.xml" /&gt;&lt;br /&gt; &amp;lt;import resource="jbpm.identity.cfg.xml" /&gt;&lt;br /&gt;&amp;lt;/jbpm-configuration&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;li&gt;Write the test case, which extends the JbpmTestCase&lt;/li&gt;&lt;br /&gt;Now, we are ready to write the process unit test.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:java"&gt;&lt;br /&gt;public class ProcessTest extends JbpmTestCase {&lt;br /&gt;String deploymentId;&lt;br /&gt;&lt;br /&gt;public void setUp() throws Exception {&lt;br /&gt; super.setUp();&lt;br /&gt; deploymentId = repositoryService.createDeployment()&lt;br /&gt;     .addResourceFromClasspath("helloworld.jpdl.xml")&lt;br /&gt;     .deploy();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void testProcess() throws Exception {&lt;br /&gt; ProcessInstance instance = executionService.startProcessInstanceByKey("helloworld");&lt;br /&gt; String pid = instance.getId();&lt;br /&gt;&lt;br /&gt; assertTrue(instance.isActive("review"));&lt;br /&gt;&lt;br /&gt; List&lt;task&gt; tasks = taskService.findPersonalTasks("alex");&lt;br /&gt; Task task = tasks.get(0);&lt;br /&gt; taskService.completeTask(task.getId(), "approved");&lt;br /&gt;&lt;br /&gt; instance = executionService.findProcessInstanceById(pid);&lt;br /&gt; String exeId = instance.findActiveExecutionIn("audit").getId();&lt;br /&gt; executionService.signalExecutionById(exeId, "to end");&lt;br /&gt;&lt;br /&gt; HistoryProcessInstance historyInstance = historyService.createHistoryProcessInstanceQuery()&lt;br /&gt;          .processInstanceId(pid).uniqueResult();&lt;br /&gt; assertEquals("ended", historyInstance.getState());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void tearDown() throws Exception {&lt;br /&gt; repositoryService.deleteDeploymentCascade(deploymentId);&lt;br /&gt; super.tearDown();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;1) we used the repositoryService to deploy our process file.&lt;br /&gt;2) we used the executionService to start the process.&lt;br /&gt;3) after it starts, it should be at the 'review' task node.&lt;br /&gt;4) used the taskService to get the specific task, and complete the task.&lt;br /&gt;5) once it completes, it should be at the 'audit' task, as it is a wait state.&lt;br /&gt;6) use the executionService.signal method to proceed the process, it goes to the 'end', which means the process should be ended.&lt;br /&gt;7) use the historyService to check whether the process is ended or not. Please noted that in the jBPM 4.0, the finished process instance was stored in a separate db table, so you can't use the executionService API to look for the finished process instances.&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;The process unit test should be passed with green in Junit, and the console output is like:&lt;br /&gt;&lt;br /&gt;Jul 12, 2009 11:08:17 AM org.hibernate.tool.hbm2ddl.SchemaExport execute&lt;br /&gt;INFO: schema export complete&lt;br /&gt;--------------------&lt;br /&gt;Made a request.....&lt;br /&gt;---------------------&lt;br /&gt;&lt;br /&gt;So, that is it, you've already built an process, and verify it. It is simple, isn't it? ;-)&lt;br /&gt;&lt;br /&gt;In next entry, I will try to deploy our process into the jBPM server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7070338884064611421?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7070338884064611421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7070338884064611421&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7070338884064611421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7070338884064611421'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/getting-started-with-jbpm-40-part-ii.html' title='Getting Started with jBPM 4.0 (Part II)'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_4KnaH_XIr1w/Slk2VVs8dpI/AAAAAAAABdA/TBRLd9jgQhU/s72-c/jbpm-helloworld-layout.gif' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3318396154872647471</id><published>2009-07-11T19:08:00.017+08:00</published><updated>2009-07-12T18:41:43.922+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='jBPM'/><title type='text'>Getting Started with jBPM 4.0 - (Part I )</title><content type='html'>&lt;a href="http://processdevelopments.blogspot.com/2009/07/jbpm-40-is-out.html"&gt;jBPM 4.0 was out&lt;/a&gt; yesterday, so I played it with a simple example, also include installing the eclipse plugin, and see the jbpm console, which I haven't tried them out before, to get a feeling about them. Below are the steps that I did, hopefully you find it helpful for you to get started.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Install jBPM and JBoss&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1. Download the &lt;a href="http://sourceforge.net/projects/jbpm/files/a%29%20jBPM%204/jbpm-4.0.zip/download"&gt;jbpm 4.0 distribution&lt;/a&gt;.&lt;br /&gt;2. Extract it into your local directory, here mine is: /local/deploy&lt;br /&gt;3. Go to jbpm-4.0/jboss.&lt;br /&gt;4. Added the build.properties into ${user.home}/.jbpm4 directory if you want to update the default properties in the ant script. (below is what I did, I used the jboss-5.0.1.GA, and I already had the zip ball in the /local/softwares directory)&lt;br /&gt;&lt;pre&gt;database=hsqldb&lt;br /&gt;jboss.version=5.0.1.GA&lt;br /&gt;jbpm.parent.dir=/local/deploy&lt;br /&gt;jboss.distro.dir=/local/softwares&lt;br /&gt;&lt;/pre&gt;You can refer to &lt;a href="http://www.jboss.org/community/wiki/jBPM4BuildingfromSource"&gt;this wiki entry&lt;/a&gt; for detail.&lt;br /&gt;5. run following command to install jboss &amp;amp; jbpm.&lt;br /&gt;&lt;pre&gt;ant install.jboss&lt;br /&gt;ant install.jbpm.into.jboss&lt;/pre&gt;Now, you go to the jbpm-4.0/jboss-5.0.1.GA, run:&lt;br /&gt;bin/run.sh -c default.&lt;br /&gt;&lt;br /&gt;It should start the jbpm server properly, later then we need to populate the schema &amp;amp; initialized sqls.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Import jBPM db schema and identity sql&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1. Go to jBPM-4.0/db, run following command to populate the schema &amp;amp; sql.&lt;br /&gt;&lt;pre&gt;ant create.jbpm.schema&lt;br /&gt;ant load.example.identities&lt;/pre&gt;Now, you can go to http://localhost:8080/jbpm-console, use the 'alex/password' as the username and password combination, you should be able to log in the jbpm console.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Install the jBPM eclipse plugin&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;I won't described the steps for its installation, as it was very well documented in the &lt;a href="http://docs.jboss.com/jbpm/v4.0/userguide/html_single/#graphicalprocessdesigner"&gt;user guide&lt;/a&gt;.&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Note, it was based on the eclipse 3.5 jee distribution.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the next entry, we will try to build a simple process by using the Eclipse GUI.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3318396154872647471?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3318396154872647471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3318396154872647471&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3318396154872647471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3318396154872647471'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/getting-started-with-jbpm-40.html' title='Getting Started with jBPM 4.0 - (Part I )'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8081369052787958708</id><published>2009-07-08T16:42:00.002+08:00</published><updated>2009-07-08T16:46:36.904+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Fedora environment setting.</title><content type='html'>I still recalled that when I used the Ubuntu, I put all of my environment variables, like JAVA_HOME et al in the .bash_profile file, and if I want to make it effect, I am running the:&lt;br /&gt;&lt;br /&gt;source .bash_profile&lt;br /&gt;&lt;br /&gt;But in Fedora, I couldn't make it effect unless I do the logout &amp; login.&lt;br /&gt;And then searched on the google, it turns out the people would do as following:&lt;br /&gt;&lt;br /&gt;put all of environment setting in the .bashrc file, and then if you update it, try to &lt;br /&gt;&lt;br /&gt;source .bash_profile&lt;br /&gt;&lt;br /&gt;It will make all of updates effective.&lt;br /&gt;&lt;br /&gt;I tried it, it works as it was told. So, now I changed my habit, put the environment setting to the .bashrc file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8081369052787958708?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8081369052787958708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8081369052787958708&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8081369052787958708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8081369052787958708'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/fedora-environment-setting.html' title='Fedora environment setting.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3208478970542408303</id><published>2009-07-08T14:13:00.005+08:00</published><updated>2009-07-08T14:34:56.631+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Scala'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>java concurrency and scala links</title><content type='html'>On the weekend, happened to read the  &lt;a href="http://refcardz.dzone.com/refcardz/core-java-concurrency?oid=hom11507"&gt;《core java concurrency》&lt;/a&gt; ref card, it is a great material, and good summary. Also, read the &lt;a href="http://macstrac.blogspot.com/2009/04/scala-as-long-term-replacement-for.html"&gt;a scala blog&lt;/a&gt; entry from &lt;a href="http://macstrac.blogspot.com/"&gt;James Strachan&lt;/a&gt;. Very interesting to read, and there are a lot of scala resources links  on the blog.&lt;br /&gt;&lt;br /&gt;Hope you enjoy these two as I do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3208478970542408303?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3208478970542408303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3208478970542408303&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3208478970542408303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3208478970542408303'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/07/java-concurrency-and-scala.html' title='java concurrency and scala links'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7107429875273579030</id><published>2009-06-29T18:54:00.003+08:00</published><updated>2009-06-29T19:00:34.308+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='jBPM'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>jBPM4.0 framework exploring</title><content type='html'>I just finished a 0.1 version of 《&lt;a href="http://people.apache.org/%7Ejeffyu/articles/zh_CN/jbpm/"&gt;jBPM 4.0 framework exploring&lt;/a&gt;》 &lt;jbpm&gt;, it is written in Chinese, I would say the jbpm4.0 framework is very neat, and easy to understand, it is very flexible.&lt;br /&gt;&lt;br /&gt;So, if you are looking for a good BPM library, then I would strongly recommend that try out the jBPM 4.0, whose GA will be supposed to be released at July 1st.&lt;br /&gt;&lt;br /&gt;If you have any comments on the article, you can leave your comments here. ;-)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/jbpm&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7107429875273579030?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7107429875273579030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7107429875273579030&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7107429875273579030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7107429875273579030'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/06/jbpm40-framework-exploring.html' title='jBPM4.0 framework exploring'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7462374083353295953</id><published>2009-06-03T15:34:00.004+08:00</published><updated>2009-06-03T15:40:01.528+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>Fedora 10 使用NetworkManager配置ADSL</title><content type='html'>在Fedora 10 下使用 NetworkManager 来配置ADSL.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;su -c NetworkManager (启动NetworkManager)&lt;/li&gt;&lt;li&gt;点击NetworkManager的图标, 看到VPN Connections, 选择Configure VPN &lt;/li&gt;&lt;li&gt;Go to DSL Tab, &lt;/li&gt;&lt;li&gt;Add DSL, 输入: username, password etc&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;然后重启 NetworkManager, 使用 DSL 来连接即可.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7462374083353295953?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7462374083353295953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7462374083353295953&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7462374083353295953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7462374083353295953'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/06/fedora-10-adsl.html' title='Fedora 10 使用NetworkManager配置ADSL'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4313269843650274929</id><published>2009-03-31T13:11:00.003+08:00</published><updated>2009-03-31T13:20:38.130+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Others'/><title type='text'>I am a Duty Fulfiller??</title><content type='html'>Noticed from &lt;a href="http://markclittle.blogspot.com/2009/03/analyze-your-blog.html"&gt;Mark's Blog&lt;/a&gt;, I've analysed my blog, it turns out &lt;a href="http://typealyzer.com/index.php"&gt;I am a Duty Fulfiller&lt;/a&gt;?&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;The responsible and hardworking type. They are especially attuned to the details of life and are careful about getting the facts right. Conservative by nature they are often reluctant to take any risks whatsoever.&lt;br /&gt;&lt;br /&gt;The Duty Fulfillers are happy to be let alone and to be able to work int heir own pace. They know what they have to do and how to do it.&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;I think I am more than a Duty Fulfiller??? Maybe it is an indication like I didn't blog often. Anyway, it is interesting. ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4313269843650274929?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4313269843650274929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4313269843650274929&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4313269843650274929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4313269843650274929'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/03/i-am-duty-fulfiller.html' title='I am a Duty Fulfiller??'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-22662934316883594</id><published>2009-03-23T13:55:00.002+08:00</published><updated>2009-03-23T13:59:57.232+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Others'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>十篇每个程序员应该读的文章,论文.(至少两遍)</title><content type='html'>今天无意看到了Michael Feather差不多一个月写的 &lt;a href="http://blog.objectmentor.com/articles/2009/02/26/10-papers-every-programmer-should-read-at-least-twice"&gt;10 Papers Every Programmer Should Read (At Least Twice) &lt;/a&gt;, 个人觉得非常有意思,里面有篇是提到Functional Programming, 现在FP是越来越引起大家的关注.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-22662934316883594?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/22662934316883594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=22662934316883594&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/22662934316883594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/22662934316883594'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/03/blog-post.html' title='十篇每个程序员应该读的文章,论文.(至少两遍)'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6702702577194002697</id><published>2009-02-18T01:13:00.003+08:00</published><updated>2009-02-18T01:24:12.696+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JUL Logger setting</title><content type='html'>Well, first I have to say that the log in Java is kind of messy, why? we got too many choices. say log4j, jakarta common logging, slf etc. And as comes with the JDK 1.5, we have the java.util.logging along with this. Come on, it is just a simple log, what the hell do we need to have these many libraries.&lt;br /&gt;&lt;br /&gt;Anyway, avoid the jar conflictions, the simplest scenario would be to pick up the java.util.logging, as it has been shipped within JDK. If you are wondering where/how to update the logging.properties file, (like log4j.properties in log4j), then here we've got &lt;a href="http://www.ociweb.com/mark/programming/JavaLogging.html"&gt;a good article&lt;/a&gt; [1] can help you.&lt;br /&gt;&lt;br /&gt;HTH.&lt;br /&gt;&lt;br /&gt;[1] In this article, for the 2nd method of updating logging.properties file, which should be located in the $JDK_HOME/jre/lib/logging.properties.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6702702577194002697?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6702702577194002697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6702702577194002697&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6702702577194002697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6702702577194002697'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/02/jul-logger-setting.html' title='JUL Logger setting'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4259625499229711198</id><published>2009-01-12T22:45:00.007+08:00</published><updated>2009-01-12T23:40:16.047+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Others'/><title type='text'>Reflection on 2008, and 2009's resolution.</title><content type='html'>I know it is a bit late for the new year resolution, but you probably know that I am kind of guy that is always behind than others. ;-)&lt;br /&gt;&lt;br /&gt;So, before I am looking forward 2009, let me just think it back on what I have done on 2008. The first big thing of it is that I got an opportunity to join in JBoss division, Redhat.&lt;br /&gt;&lt;br /&gt;Then, here are things:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Used the Fedora Linux as my day to day OS. I used Ubuntu distro on the next half year of 2007.&lt;/li&gt;&lt;li&gt;Learned that &lt;a href="http://www.jboss.com/products/platforms/soa"&gt;JBoss SOA-P&lt;/a&gt; product, initially, learning the J&lt;a href="http://www.jboss.org/jbossesb"&gt;Boss ESB&lt;/a&gt;, and then write a simple &lt;a href="http://people.apache.org/%7Ejeffyu/articles/zh_CN/jbossesb/"&gt;JBoss ESB introduction article in chinese&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Worked on a sub-project of &lt;a href="http://www.jboss.org/overlord"&gt;JBoss Overlord&lt;/a&gt;, its called &lt;a href="http://www.w3.org/TR/ws-cdl-10/"&gt;CDL(process governance)&lt;/a&gt;, and &lt;a href="http://www.jboss.com/index.html?module=bb&amp;amp;op=viewtopic&amp;amp;p=4192082"&gt;released our first Milestone in Nov 2008&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Learned the security stuff, and then have some work on security integration with opensso in JBoss SOA-P product.&lt;/li&gt;&lt;li&gt;Me, Howard and Young set up a new project on the google code, its called &lt;a href="http://code.google.com/p/twiddling"&gt;Twiddling&lt;/a&gt;, yeah, we are trying to get it as a next generation of current JBoss AS's twiddle. and we are working on it in our spare time.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;I have to say that I learn a lot since I joined in the JBoss, it is quite extensive as well. Say, not just ESB, but also BPM, BPEL, identity, security and so on. It makes me quite busy.&lt;br /&gt;&lt;br /&gt;Well, for the 2009, I am thinking that I am gonna try following things.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Learn a new languague, could be either erlang, scala or ruby? Apparently, ruby is very hooot these years. I am apt to erlang or scala. but we will see. I am thinking I am too Java centric, need to learn a new language, so that might look java in a new fresh perspective.&lt;/li&gt;&lt;li&gt;Continuing to work on/focus on ESB, BPM, Governance etc, say in the SOA area. But as the REST is easy to use compared to the web service, I would expect more and more peole are building RESTful service. I just hate to read the wsdl, bepl file. Frankly, IMHO, the wsdl and bepl were not desinged for human read. The xml was not a programming language, so if it is too large, it is out of our reading capability. &lt;/li&gt;&lt;li&gt;Get our &lt;a href="http://code.google.com/p/twiddling"&gt;Twiddling&lt;/a&gt; project out of door, hopefully in first half year of 2009. &lt;/li&gt;&lt;li&gt;Write more articles on SOA, or even JBoss AS area.&lt;/li&gt;&lt;/ol&gt;Well, I would expect that 2009 will still be a bad econimo year in world wide, but with above things in mind, I still think it should be fun.&lt;br /&gt;&lt;br /&gt;Lets go for 2009. ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4259625499229711198?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4259625499229711198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4259625499229711198&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4259625499229711198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4259625499229711198'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2009/01/reflection-on-2008-and-2009-new-years.html' title='Reflection on 2008, and 2009&apos;s resolution.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7304894335798403960</id><published>2008-11-21T14:44:00.006+08:00</published><updated>2008-11-21T16:15:44.215+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Others'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>How to conduct a good presentation.</title><content type='html'>I've listened to a lot of presentation, some of them are good, some of them are bad. I also conducted some presentation by myself. Again, some of them are bad, some of them are NOT bad. ;-).&lt;br /&gt;&lt;br /&gt;Following are some bullet points that I think are necessary to a good presentation.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;When in doubt, leave it out, or at least, talk it quickly and not talk it too deep/much.&lt;br /&gt;(只讲自己懂的东西,如果一定要说些自己不懂的,请就简单/粗浅的说)&lt;/li&gt;&lt;li&gt; Make sure you know the level of your target audience.&lt;br /&gt;(需要明白你的听众接受能力)&lt;/li&gt;&lt;li&gt; Know the time for your whole presentation, do NOT extend your presentation as much as possible.&lt;br /&gt;(知道你演讲的时间,尽量不要拖长)&lt;/li&gt;&lt;li&gt;Do NOT stay TOO LONG time in ONE slide. If it is, split it too many slides.&lt;br /&gt;(同一个演讲稿页面,别停留太长时间,如果本身内容的确需要很长时间,请把它分成几个页面)&lt;/li&gt;&lt;li&gt; If it is an introduction presentation, then EXAMPLE is very important. Cause it can attract audience quickly.&lt;br /&gt;(如果是做一个介绍性的演讲,例子很重要)&lt;/li&gt;&lt;li&gt;DO NOT talk too detail in your presentation, it is IMPOSSIBLE that people can know all of it just through you presentation. Highlight the important concepts and philosophy. You can lead people to documentation or other articles if they are interested.&lt;br /&gt;(别在演讲的时候讲的太细. 不要指望听众只通过听你的演讲就能知道全部东西,挑重点讲,然后告诉听众在哪儿可以看到更详细的例子)&lt;/li&gt;&lt;li&gt;Try not to talk fast, use some easy understand words to illustrate your concepts, if it is not easy enough, it means you didn't think well how to express it or didn't understand it deeply.&lt;br /&gt;(尽量用浅显的语言去解释,如果用太深奥的语言，说明要么你没准备好,又或者你没理解透彻)&lt;/li&gt;&lt;li&gt;If it is a product shown presentation, you'd better ask audience whether they have any questions or not in the end of each feature.&lt;br /&gt;(如果是做产品会，最好在每个特性/功能完后,问下是否有问题)&lt;/li&gt;&lt;li&gt;Preparation is the most important. Whether is successful or not, largely depends on your preparation.&lt;br /&gt;（演讲前期的准备很关键)&lt;/li&gt;&lt;/ol&gt;What other bullet points am I missing here?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7304894335798403960?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7304894335798403960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7304894335798403960&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7304894335798403960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7304894335798403960'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/11/how-to-conduct-good-presentation.html' title='How to conduct a good presentation.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2089221266911640848</id><published>2008-11-04T18:19:00.002+08:00</published><updated>2008-11-04T18:44:19.685+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><title type='text'>SAML &amp; XACML links</title><content type='html'>Some great SAML links.&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0-cd-02.pdf"&gt;SAML v2.0 Technical Overview&lt;/a&gt; (Strongly recommended)&lt;br /&gt;2. &lt;a href="http://www.ibm.com/developerworks/xml/library/x-seclay4/"&gt;Ensure portable trust with SAML&lt;/a&gt; from IBM developerworks&lt;br /&gt;3. &lt;a href="http://en.wikipedia.org/wiki/SAML_2.0"&gt;SAML 2.0&lt;/a&gt; from wikipedia&lt;br /&gt;4. &lt;a href="http://www.oracle.com/technology/pub/articles/dev2arch/2005/11/saml.html"&gt;Demystifying SAML&lt;/a&gt; from Oracle/BEA&lt;br /&gt;&lt;br /&gt;XACML links:&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://sunxacml.sourceforge.net/guide.html#xacml"&gt;Sun's XACML Implementation Programmer's Guide&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.oracle.com/technology/pub/articles/dev2arch/2004/02/xacml.html"&gt;Introduction to XACML&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://www.ibm.com/developerworks/xml/library/x-xacml/"&gt;Control information access with XACML&lt;/a&gt; from IBM developerworks&lt;br /&gt;4. &lt;a href="http://www.nsitonline.in/hemant/stuff/xacml/XACML%20Tutorial%20with%20a%20Use%20Case%20Scenario%20for%20Academic%20Institutions.htm"&gt;XACML Tutorial with a Use Case Scenario for Academic Institutions&lt;/a&gt; by Hemant Goyal&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2089221266911640848?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2089221266911640848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2089221266911640848&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2089221266911640848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2089221266911640848'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/11/saml-xacml-links.html' title='SAML &amp; XACML links'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7640869454483817024</id><published>2008-11-01T14:40:00.003+08:00</published><updated>2008-11-01T14:42:42.433+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>JBoss SOA-P 4.3.GA released.</title><content type='html'>On 30th Oct, we've just released the SOA-P 4.3.GA, this version include a great improvements. Details you can see from &lt;a href="http://jbossesb.blogspot.com/2008/10/soa-platform-43-is-released.html"&gt;here&lt;/a&gt;. Again, I just posted a &lt;a href="http://www.javaeye.com/news/4007"&gt;chinese version of release announcement&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7640869454483817024?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7640869454483817024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7640869454483817024&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7640869454483817024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7640869454483817024'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/11/jboss-soa-p-43ga-released.html' title='JBoss SOA-P 4.3.GA released.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6058067776958906343</id><published>2008-10-08T13:07:00.003+08:00</published><updated>2008-10-08T13:11:53.180+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>How to fix "Lock Assertion Failure" in Fedora</title><content type='html'>Not sure when exactly have the 'Lock Assertion Failure' warning, because it doesn't break my application in my case, so till today, I thought it was too tedious and want to get it fixed, and then I found the Ryan's blog post &lt;a href="http://necessaryandsufficient.blogspot.com/2008/06/i-tried-to-build-gwt-today-on-ubuntu.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6058067776958906343?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6058067776958906343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6058067776958906343&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6058067776958906343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6058067776958906343'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/10/how-to-fix-lock-assertion-failure.html' title='How to fix &quot;Lock Assertion Failure&quot; in Fedora'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-9068116184477227516</id><published>2008-10-06T13:52:00.004+08:00</published><updated>2008-10-06T13:58:01.772+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>Hibernate annotation of Map</title><content type='html'>If you happen to have a simple Map&amp;lt;String, String&amp;gt; to be mapped by using Hibernate annotation, and don't want to create an object by using List, such as List&amp;lt;Property&amp;gt;, the property contains the key and value member. Then you can use the Hibernate Annotation, "CollectionOfElements", it is hibernate specific, not JPA-specific. Details please refer to &lt;a href="http://i-proving.ca/space/Technologies/Hibernate/Hibernate+Annotation+Examples/Collection+of+Elements"&gt;this blog entry&lt;/a&gt;, it is well documented.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-9068116184477227516?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/9068116184477227516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=9068116184477227516&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/9068116184477227516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/9068116184477227516'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/10/hibernate-annotation-of-map.html' title='Hibernate annotation of Map'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4595272371177960455</id><published>2008-09-28T18:22:00.007+08:00</published><updated>2008-09-28T18:37:09.247+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>"JBoss ESB Introduction" article (its written in chinese).</title><content type='html'>Just finished a writing of &lt;a href="http://people.apache.org/%7Ejeffyu/articles/zh_CN/jbossesb/"&gt;JBoss ESB introduction&lt;/a&gt; in chinese, I think &lt;a href="http://www.jboss.org/jbossesb"&gt;JBoss ESB&lt;/a&gt; is a good ESB implementation, and it has plenty of quick starts, which can help you get it started very quickly. And one of its strong points is that it integrates with jBPM, JBoss Rules, Smooks seamlessly. So it worths you to check it out. Hopefully my little article can help you understand it more quickly if you can read chinese. ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4595272371177960455?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4595272371177960455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4595272371177960455&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4595272371177960455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4595272371177960455'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/09/article-its-written-in-chinese.html' title='&quot;JBoss ESB Introduction&quot; article (its written in chinese).'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8230783752512686584</id><published>2008-09-26T14:22:00.004+08:00</published><updated>2008-09-26T15:35:26.529+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Document'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Using jdocbook to write documentation</title><content type='html'>If you are trying to find a tool to write your project documentation, and you don't like to use word processor to write your articles, you know, it is web era, sometimes you won't just to have one output, and you don't want to stick to one particular format either. then the &lt;a href="http://www.jboss.org/maven-jdocbook-plugin/"&gt;JBoss Docbook&lt;/a&gt; might be of your interest.&lt;br /&gt;&lt;br /&gt;I used to use MS word to write articles, with a set of pre defined formats, such as Heading and so on, so that can produce a TOC (table of content). well, I still don't like to use Word to write articles. And then I find the &lt;a href="http://www.jboss.org/maven-jdocbook-plugin/"&gt;JBoss Docbook&lt;/a&gt; is very good and easy to use.&lt;br /&gt;&lt;br /&gt;Use the JBoss Docbook is quite easy, now it is mavenized. you just simply define dependency and then add the task in the build process, that's all. BTW, if you are using Linux box, you can open the doc by "Open with Help" without running mvn install to build it.&lt;br /&gt;&lt;br /&gt;So personally, I use Eclipse, with Xmlbuddy plugin to write the document, and it works quite well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8230783752512686584?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8230783752512686584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8230783752512686584&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8230783752512686584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8230783752512686584'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/09/using-jdocbook-to-write-documentation.html' title='Using jdocbook to write documentation'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7559537862681018151</id><published>2008-09-19T00:47:00.003+08:00</published><updated>2008-09-27T00:30:08.218+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>JBoss AS5 CR2 released.</title><content type='html'>I just post &lt;a href="http://www.javaeye.com/news/3566"&gt;a news&lt;/a&gt; about JBoss AS5 CR2 release in &lt;a href="http://www.javaeye.com/"&gt;www.javaeye.com&lt;/a&gt;, which is a quite popular in Chinese developer networks. Check it out &lt;a href="http://www.javaeye.com/news/3566"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7559537862681018151?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7559537862681018151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7559537862681018151&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7559537862681018151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7559537862681018151'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/09/jboss-as5-cr2-release-news-in-chinese.html' title='JBoss AS5 CR2 released.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-791449823415037415</id><published>2008-08-19T19:38:00.003+08:00</published><updated>2009-08-02T18:44:30.523+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><title type='text'>REST articles link.</title><content type='html'>So in case you are new to REST, in case you are still fighting to get the REST correct, or either you are trying to be involved in the REST vs WS-* debate, then following articles worth your time to read it.&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://www.infoq.com/articles/rest-introduction"&gt;A Brief Introduction to REST&lt;/a&gt; By Stefan &lt;strong style="font-weight: normal;"&gt;Tilkov&lt;/strong&gt;&lt;br /&gt;2. &lt;a href="http://www.infoq.com/articles/tilkov-rest-doubts"&gt;Addressing Doubts about REST&lt;/a&gt; By Stefan &lt;strong style="font-weight: normal;"&gt;Tilkov&lt;/strong&gt;&lt;br /&gt;3. &lt;a href="http://java.dzone.com/articles/intro-rest"&gt;Introduction to REST&lt;/a&gt; By Bill Burke&lt;br /&gt;4. &lt;a href="http://architects.dzone.com/articles/putting-java-rest"&gt; Putting Java To REST&lt;/a&gt; By Bill Burke.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Notes: Add the 'putting java to rest' article. (update on Aug 2, 2009)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-791449823415037415?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/791449823415037415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=791449823415037415&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/791449823415037415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/791449823415037415'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/08/rest-articles-link.html' title='REST articles link.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3276531455190417497</id><published>2008-08-11T16:46:00.004+08:00</published><updated>2008-08-11T16:59:11.835+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WS-CDL'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><title type='text'>Conversation Pattern</title><content type='html'>Gregor says:&lt;br /&gt;&lt;blockquote&gt;There's usually a handful of roles that are defined. And usually there's a series of message types, and that's where WSDL and XSDs can do a little bit for us, like a certain message has a certain meaning and a certain structure. So for example I buy coffee and maybe my message contains what I want and then in the case of Starbucks there are 17 optional fields for all the extra double shot; but you have some notion of what's in these messages and then you have the rules about which messages can flow in which order. And that is really the most difficult part.&lt;/blockquote&gt;&lt;blockquote&gt;And that is exactly the sort argument between the BEPL people - they say that most of the time there is a central coordinator and this works pretty well and it's executable - and then what the choreography people say - careful here, you're making a very strong assumption, really we should look at the overall conversation there could be 20 parties and they all send messages back and forth, now we should not assume that there is this one thing that controls everything. That's exactly when the people fight and, stand up, and walk off with this kind of argument.&lt;/blockquote&gt;To the point. ;-), Hope you enjoy all the interview from &lt;a href="http://www.infoq.com/interviews/gregor-hohpe-conversations"&gt;Gregor Hohpe&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3276531455190417497?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3276531455190417497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3276531455190417497&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3276531455190417497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3276531455190417497'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/08/conversation-pattern.html' title='Conversation Pattern'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2655050196251694010</id><published>2008-08-04T16:02:00.002+08:00</published><updated>2008-08-04T16:10:07.173+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Saving serializable object by using Hibernate</title><content type='html'>Well, sometimes you might want to save the object as serializable into database, with the Hibernate, it is quite simply for you to do that.&lt;br /&gt;&lt;br /&gt;1). Using @Lob annotation from hibernate-annotation library&lt;br /&gt;2). Write the ObjectInputStream, ObjectOutputstream like following thread's code.(&lt;a href="http://blog.tremend.ro/2007/02/15/untitledserializable-java-objects-in-mysql/"&gt;sebastian mitroi serializable java objects  in  mysql&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2655050196251694010?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2655050196251694010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2655050196251694010&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2655050196251694010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2655050196251694010'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/08/saving-serializable-object-by-using.html' title='Saving serializable object by using Hibernate'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7894832562334369387</id><published>2008-08-02T00:21:00.004+08:00</published><updated>2008-08-02T14:11:39.776+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>"JBI in a nutshell" presentation</title><content type='html'>Today, I conduct a 'JBI in a nutshell' in our Beijing team, because we are trying to think how to make &lt;a href="http://jboss.org/jbossesb"&gt;JBossESB&lt;/a&gt; SCA compatible. But before introduction of SCA, I'd like to share JBI spec to our team from my experience when I was working on &lt;a href="http://servicemix.apache.org/"&gt;ServiceMix&lt;/a&gt;. So here come the &lt;a href="http://jeff.yuchang.googlepages.com/JBI_Presentation.pdf"&gt;'JBI in a nutshell' ppt&lt;/a&gt; that I used today.&lt;br /&gt;&lt;br /&gt;Hopefully you will find it offers a little help for you understanding JBI, &lt;a href="http://servicemix.apache.org/"&gt;ServiceMix&lt;/a&gt;, and &lt;a href="http://www.jboss.org/jbossesb"&gt;JBossESB&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7894832562334369387?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7894832562334369387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7894832562334369387&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7894832562334369387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7894832562334369387'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/08/jbi-in-nutshell-presentation.html' title='&quot;JBI in a nutshell&quot; presentation'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-148582613624280549</id><published>2008-07-22T15:30:00.002+08:00</published><updated>2008-07-22T16:20:33.026+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSSO'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>OpenSSO installation blogs.</title><content type='html'>&lt;a href="http://blogs.sun.com/JohnD/"&gt;John&lt;/a&gt; has composed two great blogs on installing opensso.&lt;br /&gt;1.  &lt;a name="how_to_install_tomcat_6" id="how_to_install_tomcat_6"&gt;&lt;/a&gt;    &lt;a href="http://blogs.sun.com/JohnD/entry/how_to_install_tomcat_6"&gt;&lt;span class="entrytitle"&gt;How to install Tomcat 6.x then launch and configure OpenSSO&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;2.   &lt;a name="how_to_install_glassfish_then" id="how_to_install_glassfish_then"&gt;&lt;/a&gt;    &lt;a href="http://blogs.sun.com/JohnD/entry/how_to_install_glassfish_then"&gt;&lt;span class="entrytitle"&gt;How to Install GlassFish Then Policy Agent 3.0&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Very good resources for new comers of OpenSSO.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-148582613624280549?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/148582613624280549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=148582613624280549&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/148582613624280549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/148582613624280549'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/07/opensso-installation-blogs.html' title='OpenSSO installation blogs.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5866993197498198617</id><published>2008-07-20T03:20:00.008+08:00</published><updated>2008-09-08T11:06:03.780+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSSO'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Deploying OpenSSO &amp; Running its samples in JBossAS</title><content type='html'>It is a little bit tricky for me to get installed the OpenSSO against JBossAS4.x, So here I'd like to describe the steps that I am doing, if others new to opensso, hopefully it might be helpful for them.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Deploying opensso in the JBossAS&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1. Download the opensso build 4.5 zip from the &lt;a href="https://opensso.dev.java.net/public/use/index.html"&gt;opensso download page&lt;/a&gt;. (I validated build4 and 4.5 against JBossAS4.2.2.GA)&lt;br /&gt;&lt;br /&gt;2. Following the &lt;a href="http://download.java.net/general/opensso/stable/openssov1-build4/B4-ReleaseNotes.html"&gt;release note&lt;/a&gt; of deploying the opensso.war in the JBossAS4.x.&lt;br /&gt;&lt;br /&gt;3. You will also need to increase the Permsize in $JBoss/bin/run.conf by adding following option in the JAVA_OPTS line.     &lt;blockquote&gt;-XX:MaxPermSize=512m in the &lt;/blockquote&gt;4. Then start the $JBoss/bin/run.sh, you should be able to access its admin page in http://yourdomain:8080/opensso. (OpenSSO doesn't work well with the localhost, so you should specify a full qualified domain for it)&lt;br /&gt;&lt;br /&gt;5. And then you can have a default configuration from http://yourdomain:8080/opensso link.&lt;br /&gt;&lt;br /&gt;6. After you have the default configuration, you should be able to login the system by using: amAdmin, amLdapuser and with the password that you set before.&lt;br /&gt;&lt;br /&gt;OK, so above the steps to deploy the opensso.war, not much tricky here. And then, I am going to run an example that based on opensso sdk. (openssoclientsdk.jar).&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Running the example:&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;In the opensso directory that you extracted from the opensso.zip, you can see a sub-folder is: samples.&lt;br /&gt;&lt;br /&gt;1) Go to the $samples, you will see the fam-client.zip. (Because sun's commercial product name is Federation Acess Manager, that is what the fam stands for.)&lt;br /&gt;2) Unzip that fam-client.zip, you will see it contains sdk and war folders&lt;br /&gt;3) Go to the sdk folder. run the 'chmod 755 scripts/*.sh' to make the script runnable.&lt;br /&gt;4) run: 'scripts/compile-samples.sh' to build the sample code.&lt;br /&gt;5) run: 'scripts/setup.sh', (This is to configure the AMConfig.properties.)&lt;br /&gt;&lt;blockquote&gt;  Debug directory (make sure this directory exists): /var/local/tmp (This can be other places)&lt;br /&gt;Password of the server application: opensso1 (Not sure this one, I just input a random one.)&lt;br /&gt;Protocol of the server: http&lt;br /&gt;Host name of the server: putian.nay.redhat.com&lt;br /&gt;Port of the server: 8080&lt;br /&gt;Server's deployment URI: opensso&lt;br /&gt;Naming URL (hit enter to accept default value, http://putian.nay.redhat.com:8080/opensso/namingservice):&lt;br /&gt;&lt;/blockquote&gt; 6) run: "scripts/Login.sh", you will see:&lt;br /&gt;&lt;blockquote&gt;Realm (e.g. /): opensso&lt;br /&gt;Login module name (e.g. DataStore or LDAP): DataStore&lt;br /&gt;Login locale (e.g. en_US or fr_FR): en_US&lt;br /&gt;DataStore: Obtained login context&lt;br /&gt;User Name:amAdmin&lt;br /&gt;Password:&lt;br /&gt;&lt;/blockquote&gt;Input your password, it should show you like following:&lt;br /&gt;&lt;blockquote&gt;Login succeeded.&lt;br /&gt;Logged Out!!&lt;/blockquote&gt;Well, this example shows you how to do the authentication by using openssoclientsdk.jar.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: &lt;span style="color: rgb(255, 0, 0);"&gt;I am validating opensso build4 and 4.5 against JBossAS4.2.2.GA. If you have deployed the opensso.war in the JBossESB server, it has a known issue at https://jira.jboss.org/jira/browse/SOA-731&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5866993197498198617?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/5866993197498198617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=5866993197498198617&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5866993197498198617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5866993197498198617'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/07/deploying-opensso-in-jbossas.html' title='Deploying OpenSSO &amp; Running its samples in JBossAS'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6706623761937123771</id><published>2008-07-15T01:18:00.004+08:00</published><updated>2008-07-18T16:29:21.902+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JAAS and JBossSX</title><content type='html'>There are couple good articles related to the JAAS and JBossSX.&lt;br /&gt;1.&lt;a href="http://www.javaworld.com/javaworld/jw-09-2002/jw-0913-jaas.html"&gt;All that JAAS&lt;/a&gt; (Good for beginners)&lt;br /&gt;2.&lt;a href="http://www.javaworld.com/javaworld/jw-08-2001/jw-0831-jaas.html"&gt;Integrate security infrastructures with JBossSX&lt;/a&gt; by Scott Stark&lt;br /&gt;3.&lt;a href="http://www.hp-interex.com/UserFiles/File/white%20papers/Implementing%20J2EE%20security%20using%20JAAS%20on%20JBOSS.pdf"&gt;Implementing J2EE security using JAAS in JBoss&lt;/a&gt;&lt;br /&gt;4.&lt;a href="http://wiki.jboss.org/wiki/JBossSX"&gt;JBossSX wiki&lt;/a&gt;&lt;br /&gt;5.&lt;a href="http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html"&gt;JAAS Reference Guide&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6706623761937123771?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6706623761937123771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6706623761937123771&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6706623761937123771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6706623761937123771'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/07/jaas-and-jbosssx.html' title='JAAS and JBossSX'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7516183523848162786</id><published>2008-07-13T01:07:00.009+08:00</published><updated>2009-12-02T19:35:04.047+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Log4j configuration in JBoss AS.</title><content type='html'>Yeah, log4j configuration is easy, but sometimes you might find it is a little bit hard for you to configure it in JBoss AS if you are new to it. So following is the step-by-step example which I was used in &lt;a href="http://jboss.org/soag/"&gt;overlord&lt;/a&gt; &lt;a href="http://jboss.org/soag/cdl/index.html"&gt;cdl&lt;/a&gt; project.&lt;br /&gt;&lt;br /&gt;open up the jboss-log4j.xml in the $JBossAS/server/domain(ie. default)/conf folder.&lt;br /&gt;&lt;br /&gt;1. the jboss-log4j.xml default for&lt;br /&gt;&lt;root&gt;is "DEBUG", in my case, I want to change it to "INFO" level, since the "DEBUG" level is too verbose.&lt;br /&gt;&lt;blockquote&gt;&lt;&gt;&lt;br /&gt;  &lt; value="INFO"&gt;&lt;br /&gt;  &lt; ref="CONSOLE"&gt;&lt;br /&gt;  &lt; ref="FILE"&gt;&lt;br /&gt;&lt; /root &gt;&lt;br /&gt;&lt;/blockquote&gt;2. Add your own package log level to DEBUG: like&lt;br /&gt;&lt;blockquote&gt;    &lt; name="org.jboss.soa.overlord"&gt;&lt;br /&gt;  &lt; value="DEBUG"&gt;&lt;br /&gt;  &lt; /category&gt;&lt;br /&gt;&lt;/blockquote&gt;3. If you want to show the DEBUG level to the console, you also need to update the 'Threshold' level to 'DEBUG' in CONSOLE appender.&lt;br /&gt;&lt;blockquote&gt;   &lt; name="Threshold" value="DEBUG"&gt;&lt;br /&gt;&lt;/blockquote&gt;Yeah, that's all, quite easy, restart your sever, you would see it take effect. If you want to know more about JBossLog4j, you can refer to &lt;a href="http://docs.jboss.org/jbossas/AllDocsSubscription/JBossLog4j.pdf"&gt;this document&lt;/a&gt;, which was written by Scott Stark.&lt;br /&gt;&lt;br /&gt;[&lt;span style="color: rgb(255, 0, 0);"&gt;update Dec 2, 2009&lt;/span&gt;] A more convenient way for you to do the debug would be add a 'appender', and then direct ur log into that appender. like following:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;  &amp;lt;appender name="RS" class="org.jboss.logging.appender.RollingFileAppender"&gt;&lt;br /&gt;    &amp;lt;errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/&gt;&lt;br /&gt;    &amp;lt;param name="File" value="${jboss.server.log.dir}/riftsaw.log"/&gt;&lt;br /&gt;    &amp;lt;param name="Append" value="true"/&gt;&lt;br /&gt;    &amp;lt;param name="MaxFileSize" value="500KB"/&gt;&lt;br /&gt;    &amp;lt;param name="MaxBackupIndex" value="1"/&gt;&lt;br /&gt;    &amp;lt;param name="Threshold" value="DEBUG"/&gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;layout class="org.apache.log4j.PatternLayout"&gt;&lt;br /&gt;      &amp;lt;param name="ConversionPattern" value="%d %-5p [%c] %m%n"/&gt;&lt;br /&gt;    &amp;lt;/layout&gt;&lt;br /&gt;  &amp;lt;/appender&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;category name="org.apache.ode"&gt;&lt;br /&gt;    &amp;lt;priority value="DEBUG" /&gt;&lt;br /&gt;    &amp;lt;appender-ref ref="RS" /&gt;&lt;br /&gt;  &amp;lt;/category&gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;category name="org.jboss.soa.bpel"&gt;&lt;br /&gt;    &amp;lt;priority value="DEBUG" /&gt;&lt;br /&gt;    &amp;lt;appender-ref ref="RS" /&gt;&lt;br /&gt;  &amp;lt;/category&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Note: I am validating this against JBossAS4.2.2GA.&lt;/root&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7516183523848162786?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7516183523848162786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7516183523848162786&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7516183523848162786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7516183523848162786'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/07/log4j-configuration-in-jboss-as.html' title='Log4j configuration in JBoss AS.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3352117053675049636</id><published>2008-06-18T14:28:00.007+08:00</published><updated>2008-06-18T15:56:42.380+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Install Firefox3 in Fedora8.</title><content type='html'>Today is a big day for &lt;a href="http://www.mozilla.com/en-US/firefox/"&gt;Firefox&lt;/a&gt;, it just released its &lt;a href="http://www.spreadfirefox.com/en-US/worldrecord"&gt;firefox3.GA&lt;/a&gt;, with more than 15,000 improvements over firefox2.x.&lt;br /&gt;&lt;br /&gt;So, I just can't wait to give that a try, but it seems that Fedora 9 shipped with the firefox3, as for Fedora8, it still sticks to the firefox2.x. Then I look for a firefox3 rpm package for F8, here comes the &lt;a href="http://mirror.yandex.ru/fedora/tigro/8/i386/firefox3-3.0-1.fc8.i386.rpm"&gt;i86 rpm&lt;/a&gt;, it is from this thread.[1]:&lt;br /&gt;&lt;br /&gt;After you download the rpm, simply run: (Before installing firefox3, remember to keep a backup for your bookmark)&lt;br /&gt;&lt;br /&gt;rpm -i firefox3....(your rpm filename).&lt;br /&gt;&lt;br /&gt;Note: It doesn't work when I am running "yum localinstall ...", it seems failed in the GPG key check.&lt;br /&gt;&lt;br /&gt;Once you finish the installation, simply open a shell, run: firefox3, make sure you have closed all the firefox browser, otherwise, it will still runs the firefox as same as what you are using now.&lt;br /&gt;Your firefox3 and firefox2.x can be co-existed in your Fedora, but it just can be used one version at a time, it depends on which version you are firstly opened!&lt;br /&gt;&lt;br /&gt;Although I know it is not a good/easy way for us to install software by using rpm, it is better to use the yum, so that we can make sure that the library dependencies get right, but currently, I haven't found the firefox3 in the F8 repository. Hopefully someone will upload it there.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Update: Ahh.... just found we can download the tar file from mozilla directly, extract and run the "./firefox" in your console. but need to make sure you have closed all the firefox web browser, otherwise, it won't get it updated. That is when I thought this approach might not work. :(&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;1: &lt;a href="http://forums.fedoraforum.org/showthread.php?t=192028"&gt;http://forums.fedoraforum.org/showthread.php?t=192028&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3352117053675049636?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3352117053675049636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3352117053675049636&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3352117053675049636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3352117053675049636'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/06/install-firefox3-in-fedora8.html' title='Install Firefox3 in Fedora8.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3084836366901572893</id><published>2008-06-16T23:42:00.004+08:00</published><updated>2008-06-17T00:10:42.387+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mobicents'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Introduction of Mobicents</title><content type='html'>Today, my colleague &lt;a href="http://amitbhayani.blogspot.com/"&gt;Amit&lt;/a&gt; give the Beijing team a presentation on &lt;a href="http://www.jboss.org/mobicents"&gt;JBoss Mobicents&lt;/a&gt;, This project is very interesting, it is a event-based architecture. It can be deployed in the JBoss AS easily. With this project, you can easily integrate your application with telcom stuff, such as phone, SMS message etc, it also have Google talk built-in and so on. Its architecture is easily extended, if you find some protocol are missing, just feel free to implement a Resource Adapter, it is trivial.&lt;br /&gt;&lt;br /&gt;Are you tired of doing the database-backend, typcially just database operate(CRUD), enterprise application? We all know our next big thing mostly will happen on Cellphone, don't we? Then why not take a peak at Mobicents, and give it a try?&lt;br /&gt;&lt;br /&gt;See &lt;a href="http://www.jbossworld.com/downloads/pdf/friday/2-25_NEW_Web_2_and_Communications_Building_Converged_Applications_Amit_Bhayani_JBoss.pdf"&gt;Amit's presentation&lt;/a&gt; on JBossWorld this February.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3084836366901572893?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3084836366901572893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3084836366901572893&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3084836366901572893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3084836366901572893'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/06/introduction-of-mobicents.html' title='Introduction of Mobicents'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6691138307856935588</id><published>2008-06-16T22:32:00.006+08:00</published><updated>2008-06-16T22:51:01.256+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Fedora8 in Lenovo T61P with Projector</title><content type='html'>As you might know projectors often do not work well with widescreen laptop, which installed Fedora. So my T61P does not work with the projector in my office.&lt;br /&gt;Today, I've found a way to fix that. (Actually it was told by my colleague Denny). By that reducing the screen resolution and using the "Dual Head" functionality in the Display.&lt;br /&gt;&lt;br /&gt;The steps are:&lt;br /&gt;&lt;br /&gt;System -&gt; Administration -&gt; Display -&gt; Dual Head tab.&lt;br /&gt;&lt;br /&gt;Checked the "Use dual head" option.&lt;br /&gt;And then select the resolution as "1280X1024".  (Remember to save your original one as a backup in case of the change doesn't work for you and cause your xwindow broken.)&lt;br /&gt;&lt;br /&gt;And then reboot the system. Hopefully it works for you too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6691138307856935588?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6691138307856935588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6691138307856935588&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6691138307856935588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6691138307856935588'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/06/fedora8-in-t61p-with-projector.html' title='Fedora8 in Lenovo T61P with Projector'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1181536745649815917</id><published>2008-06-06T23:25:00.003+08:00</published><updated>2008-09-27T00:29:35.941+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='Chinese'/><title type='text'>Railo opensource</title><content type='html'>Railo goes opensource, and it is under the JBoss umbrella. the chinese version of this news was published &lt;a href="http://www.javaeye.com/news/2500"&gt;here&lt;/a&gt;, which is in the &lt;a href="http://www.javaeye.com/"&gt;Javaeye website&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1181536745649815917?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1181536745649815917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1181536745649815917&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1181536745649815917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1181536745649815917'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/06/railojbossorg.html' title='Railo opensource'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6323945388521259528</id><published>2008-05-19T17:14:00.004+08:00</published><updated>2009-06-08T23:40:39.771+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='Postgresql'/><title type='text'>Postgresql installation/connection in Fedora</title><content type='html'>Because I wan to try the &lt;a href="http://www.jboss.com/products/jbosson"&gt;JON 2.0&lt;/a&gt;, I gotta have a database, currently the JON supports two databases, Postgres and Oracle. So here I choose the Postgres as it is open source.&lt;br /&gt;&lt;br /&gt;I am using the Fedora8, so install the postgres just simply need to run&lt;br /&gt;&lt;blockquote&gt; yum install postgresql-server&lt;/blockquote&gt;After I installed the postgres, I created it with following command:&lt;br /&gt;&lt;blockquote&gt;   service postgresql initdb&lt;br /&gt; service postgresql start&lt;/blockquote&gt;And then I try to (as reference[1] described)&lt;br /&gt;&lt;blockquote&gt; createuser -h 127.0.0.1 -p 5432 -U postgres -S -D -R rhqadmin&lt;/blockquote&gt;it tells me that " FATAL:  Ident authentication failed for user "postgres". This error mostly means you need to update the "pg_hba.conf" file.&lt;br /&gt;&lt;br /&gt;try to run&lt;br /&gt;&lt;blockquote&gt;  ps aux | grep postmaster&lt;/blockquote&gt;to find out where the "pg_hba.conf" located. (Here thanks to illya77 and pilhuhn in #rhq at irc.freenode.net help me solve this problem).&lt;br /&gt;&lt;br /&gt;Update the pg_hba.conf  suggested, and then&lt;br /&gt;&lt;br /&gt;Edit the postgres host based access configuration file (pg_hba.conf), which typically would be at: /var/lib/pgsql/data/pg_hba.conf &lt;br /&gt;&lt;br /&gt;Modify the local line to use "trust" based authentication rather than "identity". Please review the PostgreSQL documentation before making this change and take the security&lt;br /&gt;&lt;pre&gt;local all  all   trust&lt;br /&gt;&lt;/pre&gt;After that, restart the postgresql to make the change taking effect.&lt;br /&gt;&lt;blockquote&gt;service postgresql restart&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt; At last: run&lt;br /&gt;&lt;blockquote&gt;psql -h localhost -U postgres&lt;/blockquote&gt;to see if it can log in.&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;1. &lt;a href="https://docs.jbosson.redhat.com/confluence/display/JON2/Postgres+Quick+Start+Installation+Guide"&gt; Postgres Quick Start Installation&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6323945388521259528?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6323945388521259528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6323945388521259528&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6323945388521259528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6323945388521259528'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/05/postgresql-installationconnection-in.html' title='Postgresql installation/connection in Fedora'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2033056257575227678</id><published>2008-05-05T12:44:00.002+08:00</published><updated>2008-05-05T13:48:59.450+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Using wireless in Fedora8 for T61P</title><content type='html'>1. Go to System -&gt; Administration -&gt; Network&lt;br /&gt;    You will see the wireless was shown as: wlan0&lt;br /&gt;&lt;br /&gt;2. Edit dialog, make sure the "Activate device when computer starts" unchecked&lt;br /&gt;    "Controlled by NetworkManager" checked. if you haven't installed the NetworkManager utility,&lt;br /&gt;    then use "yum install NetworkManager" command to install it.&lt;br /&gt;&lt;br /&gt;3. Go to System -&gt; Administration -&gt; Services, Checked the "NetworkManager" and "NetworkManagerDispatcher", so that they can start automatically when you start your computer.&lt;br /&gt;&lt;br /&gt;4. Reboot the system. (You can try to run: service network restart, but I just simply restarted it).&lt;br /&gt;&lt;br /&gt;PS: you can use "iwconfig" to see your wireless device, and use the "iwlist wlan0 scan" to see your available wireless. here wlan0 is your wireless device name.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2033056257575227678?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2033056257575227678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2033056257575227678&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2033056257575227678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2033056257575227678'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/05/using-wireless-in-fedora8-for-t61p.html' title='Using wireless in Fedora8 for T61P'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1222573695772295059</id><published>2008-05-01T12:51:00.008+08:00</published><updated>2008-05-10T17:36:58.128+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>My Fedora8 Roadmap on T61P</title><content type='html'>1. firstly, you need to install the Fedora8 in "text mode", because the ndivia driver issue. (be patient, this issue will be resolve in next. ;-)&lt;br /&gt;&lt;br /&gt;2. Add repositories.&lt;br /&gt;   1) &lt;a href="http://rpm.livna.org/livna-release-8.rpm"&gt;Livna&lt;/a&gt;: rpm -i http://rpm.livna.org/livna-release-8.rpm&lt;br /&gt;   2) &lt;a href="http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/7/freshrpms-release/freshrpms-release-1.1-1.fc.noarch.rpm"&gt;FreshRPMS&lt;/a&gt;: rpm -i http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/7/&lt;br /&gt;freshrpms-release/freshrpms-release-1.1-1.fc.noarch.rpm&lt;br /&gt;&lt;br /&gt;3. Two ways to solve the display/video problem.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;2.1 log in as a root, and then update the /etc/X11/xorg.conf by using "vesa" mode, it should be located in the "Dirver" section. basically, need to change from the "nv" to "vesa" in a refresh installation.&lt;/li&gt;&lt;li&gt;2.2 using "yum install kmod-nvidia, xorg-x11-drv-nvidia", if it asks you to upgrade the kernel first, which is my case.  I need to run the "yum update kernel".&lt;br /&gt;After you installed the drivers, and run the "startx" to log in the X window.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;4. Install compiz packages, 3D effect.&lt;br /&gt;    Detail please see &lt;a href="http://www.fedoraguide.info/index.php/Main_Page#Compiz-fusion_.283D_effects.29"&gt;this link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;5. Install chinese-input &amp; fonts&lt;br /&gt;    See my the other &lt;a href="http://jeffyuchang.blogspot.com/2008/03/fedora8-installation.html"&gt;blog entry here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;6. Update System.&lt;br /&gt;   "yum -y upgrade"&lt;br /&gt;&lt;br /&gt;7. Other softwares.&lt;br /&gt;   yum install xchat,&lt;br /&gt;                     stardict, &lt;br /&gt;                     skype,&lt;br /&gt;                     thunderbird,&lt;br /&gt;                     xmms, xmms-mp3, xmms-wma,&lt;br /&gt;                     mplayer,smplayer&lt;br /&gt;                     ......&lt;br /&gt;    &lt;br /&gt;8. Update the default level for initialization.&lt;br /&gt;   By default, the machine will run on Level 3, it means that it won't start the X window automatically, you can modify it in "/etc/inittab" file, around line 18.&lt;br /&gt;&lt;br /&gt;[Reference]&lt;br /&gt;1. &lt;a href="http://www.thinkwiki.org/wiki/Installing_Fedora_8_on_a_ThinkPad_T61p"&gt;Fedora8 on ThinkPad T61P&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://gka-linux.blogspot.com/2007/11/my-fedora-8-road-map.html"&gt;Gustavo's Fedora8 roadmap &lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://www.fedoraguide.info/index.php/Main_Page"&gt;Fedora8 Guide&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1222573695772295059?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1222573695772295059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1222573695772295059&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1222573695772295059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1222573695772295059'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/05/my-fedora8-roadmap-on-t61p.html' title='My Fedora8 Roadmap on T61P'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4489114173230811833</id><published>2008-05-01T12:22:00.003+08:00</published><updated>2008-05-01T12:29:25.869+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Dell D820 and Lenovo ThinkPad T61P</title><content type='html'>I got my new laptop (Lenovo ThinkPad T61p) on Tuesday, after I removed the Windows Vista(It is god damn hard to use compare to Windows XP), and installed the Fedora 8. currently, it works like a charm, and I found I like it very much, with the nvidia drivers up (with 3D support), the appearance looks great compare to the one that I install it in my office PC.&lt;br /&gt;&lt;br /&gt;After played in the T61P, I found the feelings on its keyboard is much better than in the Dell D820, it makes you want to code as much as possible. ;-), I know, a lot of people are fond of the Lenovo (ex IBM) Laptop keyboard, just haven't got a chance to use it myself..&lt;br /&gt;&lt;br /&gt;So, I would not consider to buy next laptop from Dell again...maybe will stick to the ThinkPad series, or Apple as my alternative..:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4489114173230811833?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4489114173230811833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4489114173230811833&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4489114173230811833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4489114173230811833'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/05/dell-d820-and-lenovo-thinkpad-t61p.html' title='Dell D820 and Lenovo ThinkPad T61P'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-702997477386498952</id><published>2008-04-22T11:18:00.005+08:00</published><updated>2008-04-23T14:19:55.096+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Open source business in Redhat</title><content type='html'>As I said earlier, I've joined in the Redhat JBoss Divsion after IONA closed down the Beijing R&amp;D. In the Redhat, it is a bit different from what I used to know about open source business.&lt;br /&gt;&lt;br /&gt;Redhat now has two open source distribution. One is &lt;a href="http://fedoraproject.org/"&gt;Fedora&lt;/a&gt;, the other is RedHat Enterprise Linux, (RHEL for short).&lt;br /&gt;&lt;br /&gt;Actually, Fedora is a community distribution, which means it is not only developed by Redhatters, but in the community. and it releases twice a year, you can free to download the fedora and use it without any charges.&lt;br /&gt;&lt;br /&gt;In the other hand, the RHEL is distributed by Redhat Corp, its packages, softwares are from the Fedora selectively, it is well tested by redhatters, it just release once in two years. The main object for RHEL is the stable. If you need to use the RHEL, then you need to pay the subscribe fee to Redhat.&lt;br /&gt;&lt;br /&gt;So, this is how Redhat runs the Operating System. After Redhat acquired the JBoss, now we run the JBoss Open Source similiar to what we do in the OS.&lt;br /&gt;&lt;br /&gt;We have &lt;a href="http://www.jboss.org"&gt;jboss.org&lt;/a&gt; and &lt;a href="www.jboss.com"&gt;jboss.com&lt;/a&gt; two websites, which the jboss.org is a community version, it releases more often in the jboss.org. whereas we only release 1 or 2 times each year for the jboss.com.&lt;br /&gt;we also guarantee that the jboss.com distribution is well-tested, more stable than the community one.&lt;br /&gt;&lt;br /&gt;I think this solution makes sense, in the community one, we are after cutting edge technology, most advance ideas and so on, but in the company one, we are also using cutting-edge technology, but we primarily focus on its stable for enterprise use.&lt;br /&gt;&lt;br /&gt;For more detailed information on this, please see &lt;a href="http://andrigjboss.blogspot.com/2008/04/why-adopt-jboss-enterprise-platforms.html"&gt;Andrig's post&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-702997477386498952?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/702997477386498952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=702997477386498952&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/702997477386498952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/702997477386498952'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/04/open-source-business-in-redhat.html' title='Open source business in Redhat'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1881078918724823337</id><published>2008-04-15T10:33:00.002+08:00</published><updated>2008-04-15T11:21:42.773+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><title type='text'>service-based enterprise integration pattern made easy</title><content type='html'>A new artilce from Dr. Waseem Roshen, in the series titled: &lt;a href="http://www.ibm.com/developerworks/views/webservices/libraryview.jsp?search_by=Services-based+enterprise+integration+patterns+made+easy"&gt;Services-based enterprise integration patterns made easy&lt;/a&gt;, it is quite interesting and easy-read to know the Enterprise Integration concepts. and also a little background.;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1881078918724823337?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1881078918724823337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1881078918724823337&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1881078918724823337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1881078918724823337'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/04/service-based-enterprise-integration.html' title='service-based enterprise integration pattern made easy'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3624073728468169240</id><published>2008-04-14T15:14:00.009+08:00</published><updated>2008-09-15T22:50:53.077+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WS-CDL'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><title type='text'>Brief Introduction on the WS-CDL</title><content type='html'>Because of the work's need, I need to work on the integration between the &lt;a href="http://pi4soa.wiki.sourceforge.net/"&gt;WS-CDL Tool&lt;/a&gt; and &lt;a href="http://www.jboss.org/jbossesb"&gt;JBoss ESB&lt;/a&gt;, and here comes the chance that need to take a look at the WS-CDL specification.&lt;br /&gt;&lt;br /&gt;Why the WS-CDL specification exists? what is it for? IMHO, now we have the WSDL as a contract to define the service in a language-independent way.  we can consider the "interface" as a contract definition in the JAVA world. But we don't have any thing to define the collaboration contract among multiple participants yet. Some people might say the UML Sequence diagram is a way to document it, but it lacks of the data description which has been used in the exchanges in the collaboration.&lt;br /&gt;&lt;br /&gt;With the WS-CDL spec and its according tool, it can help us to design a system from top-down approach, well, it is sort of reminding me the era of MDA(Model Driven Architecture), personally, I am not a fan of MDA, that includes a lot of code generation. To some extent, WS-CDL is belong to the MDA, but as I said before, WS-CDL just defines the contract that multiple participants are working, it is not trying to describe everything in detail, so that you can build the whole system with one "Generate Code" click.&lt;br /&gt;&lt;br /&gt;WS-CDL is mainly used for the Business Analyst. With current tools support, it can generate to WS-BPEL or Java skeleton code.&lt;br /&gt;&lt;br /&gt;So, back to the WS-CDL specification itself, what is it composed of?&lt;br /&gt;&lt;br /&gt;1. Collaborating Participants&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    1.1 RoleType   -- It defines the role, as the minimum unit for participants.&lt;/li&gt;&lt;li&gt;    1.2 RelationshipType -- It defines the relationship in roles.&lt;/li&gt;&lt;li&gt;    1.3 ParticipantType -- It is consist of one or multiple roles.&lt;/li&gt;&lt;li&gt;    1.4 ChannelType -- How and where participants collaborate.&lt;/li&gt;&lt;/ul&gt;2. Information Driven Collaborations&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    2.1 InformationType -- described the type of information used, simple wrapper for xsd.&lt;/li&gt;&lt;li&gt;    2.2 Variable&lt;/li&gt;&lt;li&gt;    2.3 Expressions&lt;/li&gt;&lt;li&gt;    2.4 Token and TokenLocator. (Tokens differ from variables in that variables contain values which MAY be populated as the result of actions or events within a choreography life-line whereas tokens contain information that define the piece of the data that is relevant.)&lt;/li&gt;&lt;li&gt;    2.5 WorkUnit&lt;/li&gt;&lt;li&gt;    2.6 Choreography&lt;/li&gt;&lt;li&gt;    2.7 Choreography Life-line&lt;/li&gt;&lt;li&gt;    2.8 Choreography Exception Handling&lt;/li&gt;&lt;li&gt;    2.9 Choreography Finalization&lt;/li&gt;&lt;/ul&gt; &lt;br /&gt;3. Activities&lt;br /&gt;&lt;br /&gt; 3.1 Ordering Structures&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    3.1.1 Sequence&lt;/li&gt;&lt;li&gt;    3.1.2 Parallel&lt;/li&gt;&lt;li&gt;    3.1.3 Choice&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt; 3.2 Interacting&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    3.2.1 Interaction Based Information Alignment.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;For full and detailed explanation please see &lt;a href="http://www.w3.org/TR/ws-cdl-10/"&gt;WS-CDL specification.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also, see &lt;a href="http://www.infoq.com/presentations/hohpe-soa-conversations"&gt;Gregor's Presentation &lt;/a&gt; at infoQ.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3624073728468169240?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3624073728468169240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3624073728468169240&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3624073728468169240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3624073728468169240'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/04/brief-introduction-on-ws-cdl.html' title='Brief Introduction on the WS-CDL'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-665001176126524482</id><published>2008-04-07T15:31:00.009+08:00</published><updated>2008-09-15T22:50:37.857+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WS-CDL'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><title type='text'>Links on WS-CDL.</title><content type='html'>Firstly, WS-CDL stands for Web Services Choreography Description Language.&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://www.ebpml.org/ws_-_cdl.htm"&gt;An introduction &amp;amp; comparison between WS-CDL and WS-BPEL&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.w3.org/TR/ws-cdl-10/"&gt; WS-CDL spec&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://weblogs.java.net/blog/johnreynolds/archive/2006/01/service_orchest.html"&gt;Two definition explanations on WS-CDL and WS-BPEL&lt;/a&gt; from John Reynolds. Also the two comments from Steve is very good.&lt;br /&gt;4. &lt;a href="http://www.w3.org/TR/2006/WD-ws-cdl-10-primer-20060619/"&gt;An WS-CDL example illustration&lt;/a&gt;&lt;br /&gt;5. &lt;a href="http://babel.ls.fi.upm.es/%7Efred/papers/jsweb2006.pdf"&gt;Implementing WS-CDL essay&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And if you want to know more about WS-CDL, then DO NOT miss below two links.&lt;br /&gt;1) &lt;a href="http://pi4tech.blogspot.com/"&gt;Pi4Tech Blog&lt;/a&gt;&lt;br /&gt;2) &lt;a href="http://www.pi4.org/"&gt;Pi4.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Update:&lt;/span&gt; Add the 'implementing ws-cdl essay' on Aug 4, 2008.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-665001176126524482?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/665001176126524482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=665001176126524482&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/665001176126524482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/665001176126524482'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/04/links-on-ws-cdl.html' title='Links on WS-CDL.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-377047251399771794</id><published>2008-04-05T19:19:00.002+08:00</published><updated>2008-04-05T19:23:57.002+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Links on WS-BPEL</title><content type='html'>1. &lt;a href="http://www.eclipse.org/tptp/platform/documents/design/choreography_html/tutorials/wsbpel_tut.html"&gt;WS-BPEL 2.0 Tutorial&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html"&gt;WS-BPEL Specification&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-377047251399771794?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/377047251399771794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=377047251399771794&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/377047251399771794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/377047251399771794'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/04/links-on-ws-bpel.html' title='Links on WS-BPEL'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2125190452828752821</id><published>2008-04-03T14:54:00.003+08:00</published><updated>2008-04-05T19:04:50.675+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><title type='text'>How to design new services? Best Practise.</title><content type='html'>This is an very interesting blog. &lt;a href="http://jbossesb.blogspot.com/2007/08/how-to-design-new-services-best.html"&gt;How to design new services? Best Practise&lt;/a&gt; From Kurt Stam, and those comments are also worth you reading.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2125190452828752821?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2125190452828752821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2125190452828752821&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2125190452828752821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2125190452828752821'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/04/how-to-design-new-services-best.html' title='How to design new services? Best Practise.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2539294285833758353</id><published>2008-04-02T15:41:00.009+08:00</published><updated>2008-07-27T14:57:26.164+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Integration Specifiations - JBI spec</title><content type='html'>As I said in the last entry, it has drawback in the JCA spec for Enterprise integration, besides, we can not put the JCA in the Message Oriented Middleware category, which JBI, JMS were in.&lt;br /&gt;&lt;br /&gt;Ok, today I am talking about the JBI spec, firstly it stands for Java Buisiness Integration, and it is a way to combine all the existing services. In the JBI Spec, we are talking about nothing but service, and the Message is the unit that we are exchanging.&lt;br /&gt;&lt;br /&gt;JBI as a container spec, its content can split into two category.&lt;br /&gt;1. Runtime&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   1) Normalized Message&lt;/li&gt;&lt;li&gt;   2) Normalized Message Router&lt;/li&gt;&lt;li&gt;   3) Component&lt;/li&gt;&lt;li&gt;       3.1 Binding Component -&gt; which connects to the outside endpoint&lt;/li&gt;&lt;li&gt;       3.2 Service Engine  -&gt; which locates in the ESB itself.&lt;/li&gt;&lt;li&gt;   4) DeliveryChannel&lt;/li&gt;&lt;li&gt;   5) Message Exchange Pattern&lt;/li&gt;&lt;/ul&gt;2. Management&lt;br /&gt;&lt;ul&gt;&lt;li&gt; 1) Packaging&lt;/li&gt;&lt;li&gt;2) Component installation&lt;/li&gt;&lt;li&gt;3) Service deployment.&lt;/li&gt;&lt;li&gt;4) Monitor&lt;/li&gt;&lt;/ul&gt;We can see that the management functionality is to help the runtime. The primary function of runtime is to route message from one component to another. Messages are delivered in a Normalized Message, which was described in WSDL2.0, and the Normalized Message Router are in charge of routing, you also can use servicemix-eip component or &lt;a href="http://activemq.apache.org/camel"&gt;Apache Camel&lt;/a&gt; to help you build more complicated routing.&lt;br /&gt;&lt;br /&gt;JBI environment is consist of components, it makes no sense if there are no components. component can divide into two category in terms of logical functionality. One is Binding Component, which we can see as a bridge to connect the outside service. The other is the Service Enginee that located in its inner ESB.&lt;br /&gt;&lt;br /&gt;Once we have the Router, Component. we also introduce a channel, which called Delivery Channel in the JBI spec for communicating between Normalized Message Router and Components.&lt;br /&gt;&lt;br /&gt;At last, seems there are many kinds of message exchange categories, such as One-Way, Request-Response etc, we introduced a Message Exchange Pattern concept to represent this.&lt;br /&gt;&lt;br /&gt;Well, for the JBI 1.0, I think pros in it is: Normalized Message, Normalized Message Router. And things not good are: Component specific API, not easy to write a SU, SA..&lt;br /&gt;&lt;br /&gt;PS: Freeman and I wrote a presentation about Apache ServiceMix, which is JBI 1.0 compliant. you can download from &lt;a href="http://jeff.yuchang.googlepages.com/servicemix.pdf"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2539294285833758353?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2539294285833758353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2539294285833758353&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2539294285833758353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2539294285833758353'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/04/integration-specifiations-jbi-spec.html' title='Integration Specifiations - JBI spec'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-535389004677429135</id><published>2008-03-31T14:27:00.011+08:00</published><updated>2008-07-27T14:58:25.176+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Integration Specifiations - JCA spec</title><content type='html'>In this series, I am going to talk about three Java Specifications, they are JCA, JBI, JMS spec. I would say these three specs are all for integrating with exsiting legacy system, such as Enterprise Information System(EIS).&lt;br /&gt;&lt;br /&gt;Firstly, lets see what JCA spec is about. Before the JCA spec was introduced, the vendors were using their own proprietary API to do the integration, and it was non-portable, I mean, switch from different Application Servers.&lt;br /&gt;&lt;br /&gt;So here comes the specification that tries to build a standard API to solve the portable problem as JavaEE did. The JCA spec is consist of two participants. one is Application Server Vendor, the other is Resource Adapter provider.&lt;br /&gt;&lt;br /&gt;For the application server vendor, most part of job is to support the resource adapter deployment. so I will examine the spec from resource adapter provider's perspective.&lt;br /&gt;&lt;br /&gt;Here is the list that resource adapter needs to accomplish, it falls two main buckets:&lt;br /&gt;&lt;br /&gt;1. Outbound Connection. (outside systems initiate data request to your system).&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   1). Connection Management Contract&lt;/li&gt;&lt;li&gt;   2). Transaction Management Contract&lt;/li&gt;&lt;li&gt;   3). Security Management Contract&lt;/li&gt;&lt;/ul&gt;2. Inbound Connection. (your system initiates data request to other systems)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   1). Lifecycle Management Contract.&lt;/li&gt;&lt;li&gt;   2). Message Inflow Contract.&lt;/li&gt;&lt;/ul&gt;It seems that JCA spec would solve the integration against legacy systems, the truth is that the JCA spec is  designed to support the traditional request-response model, but fails to support complex long running transactions and integrations scenarios, because most of integration scenarios like to support it in asynchronous way.&lt;br /&gt;&lt;br /&gt;So here comes to JBI spec that tries to rescue, which I am going to describe in next entry....&lt;br /&gt;&lt;br /&gt;References&lt;br /&gt;[1] &lt;a href="http://www.javaworld.com/javaworld/jw-11-2001/jw-1121-jca.html?page=1"&gt;connect the enterprise with JCA.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-535389004677429135?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/535389004677429135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=535389004677429135&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/535389004677429135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/535389004677429135'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/integration-specifiations.html' title='Integration Specifiations - JCA spec'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5108489481497865482</id><published>2008-03-27T16:44:00.009+08:00</published><updated>2008-03-31T16:18:53.870+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Life'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><title type='text'>World is flat, Working from home.</title><content type='html'>My ex company &lt;a href="http://www.iona.com/"&gt;IONA&lt;/a&gt; just closed down the Beijing R&amp;amp;D center in January 2008. You can see this news from &lt;a href="http://ie.mofcom.gov.cn/aarticle/jmxw/200802/20080205367694.html"&gt;this link.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;IONA has an open source division, which is consist of couple people, which has been acquired from the Logicblaze.  They are mostly invovled in Apache Servicemix, ActiveMQ, Geronimo. and they are all working from home.&lt;br /&gt;&lt;br /&gt;But in china, I still haven't seen any people that is working from home, and I remembered couple years ago, it seems it is quite often that you can work from home oversea. Right now, I am joining in the &lt;a href="http://www.redhat.com/"&gt;Redhat Beijing R&amp;amp;D&lt;/a&gt; &lt;a href="http://www.jboss.org/"&gt;JBoss&lt;/a&gt; division, although I am still in probation period, but I would still want to say that "We are able to work from home here", although it is just 1-2 days per weeek, but this is AWESOME already!!! This is a great improvement, I would say that this phenomenon will become more and more common in china in the future, i am looking forward to that day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5108489481497865482?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/5108489481497865482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=5108489481497865482&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5108489481497865482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5108489481497865482'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/world-is-flat-working-from-home.html' title='World is flat, Working from home.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5751505467971017748</id><published>2008-03-25T10:53:00.004+08:00</published><updated>2008-03-31T16:17:29.119+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><title type='text'>Fedora8 installation</title><content type='html'>Because I need to use fedora in my company, below are some install instruction.&lt;br /&gt;&lt;br /&gt;1. Input chinese input.&lt;br /&gt; 1) running: yum groupinstall chinese-support&lt;br /&gt; 2) System -&gt; Preference -&gt; Personal -&gt; InputMethod: Tick enable input method feature option.&lt;br /&gt;&lt;br /&gt;2. Polish the chinese font.&lt;br /&gt; 1) Copy the fonts from Windows system.&lt;br /&gt;     cd /usr/share/fonts&lt;br /&gt;     mkdir windows&lt;br /&gt;     cp all windows font on it.&lt;br /&gt;     fc-cache /usr/share/fonts/windows&lt;br /&gt;     fc-cache -fv&lt;br /&gt;  2) restart Xwindow&lt;br /&gt;  3) Update the System font and firefox fonts accordingly.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;[1] &lt;a href="http://sandajian.googlepages.com/fedora8-chinese"&gt;http://sandajian.googlepages.com/fedora8-chinese&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://www.5istudy.cn/system/unix-linux/Fedora7-332.html"&gt;http://www.5istudy.cn/system/unix-linux/Fedora7-332.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5751505467971017748?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/5751505467971017748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=5751505467971017748&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5751505467971017748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5751505467971017748'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/fedora8-installation.html' title='Fedora8 installation'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8431568852144514736</id><published>2008-03-23T21:35:00.009+08:00</published><updated>2008-05-01T13:40:04.389+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fedora'/><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>This is the way to install software, are you using it?</title><content type='html'>I know it is a bit later to write an entry about this installing way, you know, I am always a bit later than it should be. ;(. anyway, it is better than never.:)&lt;br /&gt;&lt;br /&gt;If you read my blog, you might know I am using the Ubuntu these days, and I am comfortable with the "apt-get" utility (actually, it is from the Debian distro) to install the software that I want, I think this way is far better than the old way, which needs you download the software into your local disk and install it. In Ubuntu, if you need to install a software, lets say it called "eva", you just simply run the command: sudo apt-get install eva. and then it will download and install from the internet. It doesn't need you to find the eva in the internet.&lt;br /&gt;&lt;br /&gt;Today, I am trying to use the fedora distro, and I found there is an similar utility called "yum", which is "apt-get" in Ubuntu. Suddenly, I think of the "features" module in the &lt;a href="http://servicemix.apache.org"&gt;Apache Servicemix&lt;/a&gt; &lt;a href="http://servicemix.apache.org/SMX4KNL/index.html"&gt; Kernel&lt;/a&gt;, it uses the similar way to install the feature, such as NMR feature. Actually, I can't say it is belong to the servicemix functionality, it stems from the OSGi, which has an OBR (OSGi Bundle Repository).&lt;br /&gt;&lt;br /&gt;Software is quite different from other commodities, it is very nature for us to see a software with a version, but it is not common for us to have a version with other commodities. The stuff with version also means it changes a lot and very frequent. it means you need to update the software from time to time to make it up-to-date, for the security or functionality sake.  The other aspect of software is dependency, the softwares are connected, most of time they are not isolated. So here comes the "dependency" issue for the software library.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://maven.apache.org"&gt;Apache Maven&lt;/a&gt; is famous on resolving the "dependency" issue, it introduces the "pom.xml" file, which you can declare the repository and the library that you used in your project.&lt;br /&gt;&lt;br /&gt;So back to the "apt-get" utility or "yum" utility in linux distro, it typically has a config file which contains the repository url, take ubuntu for example, it is in the "/etc/apt/sources.list". You can add/update the repository url, which contains the packages or softwares. if you need to install/upgrade/remove a software, simply running below commands:&lt;br /&gt;    &lt;pre&gt; apt-get install/upgrade/remove "softwareName"&lt;/pre&gt;&lt;br /&gt;but this should be happening that your computer are connected..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8431568852144514736?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8431568852144514736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8431568852144514736&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8431568852144514736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8431568852144514736'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/new-way-to-install-packages.html' title='This is the way to install software, are you using it?'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3030291835797955967</id><published>2008-03-20T00:50:00.002+08:00</published><updated>2008-03-23T22:44:20.414+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu Tips - Part one</title><content type='html'>1. You need to set the ubuntu environment in /etc/profile, such as JDK setting and so on. putting other settings that need to be initialized firstly in the .bashrc.&lt;br /&gt;&lt;br /&gt;2. Install software in the /usr/local/share/applications&lt;br /&gt;&lt;br /&gt;3. Install packages in the /opt/ folder.&lt;br /&gt;&lt;br /&gt;4. start or stop vsftp server&lt;br /&gt;     sudo  /etc/init.d/vsftpd [start | stop | restart] &lt;br /&gt;&lt;br /&gt;5. Install printer from window-shared.&lt;br /&gt;    * install the samba&lt;br /&gt;    * System -&gt; Administration -&gt; Printing -&gt; New Printer&lt;br /&gt;&lt;br /&gt;6.  Accessing Windows shared files. (samba server is required)&lt;br /&gt;Open nautilus，CTRL+L，in the location input smb://192.168.100.x .&lt;br /&gt;&lt;br /&gt;7.  Use xchm to open the chm file.&lt;br /&gt;&lt;br /&gt;8. Using du -sh File to show the File size. such as: &lt;br /&gt;     du -sh /opt/downloads&lt;br /&gt;&lt;br /&gt;9. Press "CTRL + H" to show the hidden files in the nautilus.&lt;br /&gt;&lt;br /&gt;10. Show what kind of process occupy the "sound"&lt;br /&gt;    lsof  /dev/snd/controlC0&lt;br /&gt;&lt;br /&gt;11. Create a soft link:&lt;br /&gt;     ln -s source target&lt;br /&gt;&lt;br /&gt; 12. Remove a link:&lt;br /&gt;     unlink linkName&lt;br /&gt;&lt;br /&gt; 13. for the bz2 archive, use &lt;br /&gt;bunzip2 fileName.bz2 to extract the archive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3030291835797955967?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3030291835797955967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3030291835797955967&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3030291835797955967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3030291835797955967'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/ubuntu-tips-from-me.html' title='Ubuntu Tips - Part one'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6240182478341938400</id><published>2008-03-17T20:17:00.007+08:00</published><updated>2008-03-20T00:59:27.945+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Make voice input correctly.</title><content type='html'>I'm stuck with no voice input problems, just got it solved today. hope it helps for you. &lt;br /&gt;&lt;br /&gt;double click the "sound" icon to open up the volume control dialog, and then&lt;br /&gt;&lt;br /&gt;Playback --&gt; Capture Mux, make it mute.&lt;br /&gt;Options: Input Source -&gt; Front Misc.&lt;br /&gt;Switches: IEC958 Capture checked.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6240182478341938400?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6240182478341938400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6240182478341938400&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6240182478341938400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6240182478341938400'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/make-voice-input-correctly.html' title='Make voice input correctly.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8151017988673082472</id><published>2008-03-16T23:57:00.004+08:00</published><updated>2008-03-17T01:09:33.545+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Log in QQ in Ubuntu</title><content type='html'>I guess this is most useful for chinese people, since most of us are having QQ.&lt;br /&gt;So in case the Pidgin has troubles in logging in QQ, which as same as I have right now. Two other stuff that you could have a go.&lt;br /&gt;1. install Eva software:&lt;br /&gt;   sudo apt-get install eva    &lt;br /&gt;&lt;br /&gt;   if you can't input Chinese, open a chat dialog, right click, choose the scim. Details please see &lt;a href="http://www.agou.com/?action=show&amp;id=14"&gt;Install Eva in ubuntu&lt;/a&gt;&lt;br /&gt;   &lt;br /&gt;2. Using web based tool, such as http://www-t1.meebo.com.cn/index.html.&lt;br /&gt;&lt;br /&gt;The Eva software has a bit trouble in accepting files which I test today, but chat is ok, I guess if you do want to receive a file in the ubuntu, then other IM might be a good choice for you to do that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8151017988673082472?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8151017988673082472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8151017988673082472&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8151017988673082472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8151017988673082472'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/log-in-qq-in-ubuntu.html' title='Log in QQ in Ubuntu'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5791496627766822536</id><published>2008-03-16T01:54:00.002+08:00</published><updated>2008-03-16T01:57:58.201+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Install amule in Ubuntu</title><content type='html'>In case you want to use the emule to download materials, then amule is the thing that you are looking for in the ubuntu.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;1. &lt;a href="http://forum.ubuntu.org.cn/viewtopic.php?t=40336&amp;postdays=0&amp;postorder=asc&amp;start=0"&gt;Install amule&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5791496627766822536?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/5791496627766822536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=5791496627766822536&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5791496627766822536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5791496627766822536'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/install-amule-in-ubuntu.html' title='Install amule in Ubuntu'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5122049981407850831</id><published>2008-03-15T18:43:00.005+08:00</published><updated>2008-03-16T01:57:30.694+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Multiple sounds can exist at same time in Ubuntu7.10</title><content type='html'>See this link for details, it works for me.&lt;br /&gt;1. &lt;a href="http://forum.ubuntu.org.cn/viewtopic.php?t=132&amp;amp;highlight=%BB%EC%D2%F4"&gt;Mutliple sounds co-exist&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5122049981407850831?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/5122049981407850831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=5122049981407850831&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5122049981407850831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5122049981407850831'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/multiple-sounds-can-existed-in.html' title='Multiple sounds can exist at same time in Ubuntu7.10'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-94759384279566040</id><published>2008-03-15T15:18:00.004+08:00</published><updated>2008-03-15T15:23:05.502+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Make XMMS show chinese font correctly.</title><content type='html'>Below is the steps that work for me, which is Ubuntu7.10.&lt;br /&gt;&lt;br /&gt;1. Create a .gtkrc.mine file with following content:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# $(gtkconfigdir)/gtkrc.zh_CN&lt;br /&gt;#&lt;br /&gt;# This file defines the fontsets for Chinese language (zh) using&lt;br /&gt;# the simplified chinese standard GuoBiao as in mainland China (CN)&lt;br /&gt;#&lt;br /&gt;# 1999, Pablo Saratxaga &lt;pablo@mandrakesoft.com&gt;&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;style "gtk-default-zh-cn" {&lt;br /&gt;fontset = "-adobe-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\&lt;br /&gt;-*-*-medium-r-normal--16-*-*-*-*-*-gb2312.1980-0,*-r-*"&lt;br /&gt;}&lt;br /&gt;class "GtkWidget" style "gtk-default-zh-cn"&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2. sudo apt-get install xmms-mpg123-ja&lt;br /&gt;&lt;br /&gt;3. Set the XMMS font as: &lt;br /&gt;&lt;pre&gt; -adobe-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,&lt;br /&gt;           -*-*-medium-r-normal--16-*-*-*-*-*-gb2312.1980-0,*-r-*&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;1. &lt;a href="http://forum.ubuntu.org.cn/about10340-0.html"&gt;http://forum.ubuntu.org.cn/about10340-0.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-94759384279566040?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/94759384279566040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=94759384279566040&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/94759384279566040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/94759384279566040'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/make-xmms-show-chinese-font-correctly.html' title='Make XMMS show chinese font correctly.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-851315729365801701</id><published>2008-03-14T19:08:00.004+08:00</published><updated>2008-03-14T20:09:13.233+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Install Mplayer in the Ubuntu7.10</title><content type='html'>1. sudo apt-get install mplayer mplayer-fonts mozilla-mplayer&lt;br /&gt;2. Download the win32codec from &lt;a href="http://www.mplayerhq.hu/design7/dload.html"&gt;http://www.mplayerhq.hu/design7/dload.html&lt;/a&gt;, Choose the "Binary Codec Packages" title, the file name is sort of "linux x86 ...".&lt;br /&gt;3. Extract the win32codec from the package in the /usr/lib/win32. (create it if it doesn't exist).&lt;br /&gt;4. Start the Mplayer, it should be all set.&lt;br /&gt;&lt;br /&gt;Q: Can play the sound ok, but without having any images.&lt;br /&gt;A: running: sudo apt-get install libstdc++5 in the Shell.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;1. &lt;a href="http://wiki.ubuntu.org.cn/%E5%AE%89%E8%A3%85MPlayer"&gt;Install MPlayer&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://forum.ubuntu.org.cn/viewtopic.php?t=108805"&gt;http://forum.ubuntu.org.cn/viewtopic.php?t=108805&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-851315729365801701?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/851315729365801701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=851315729365801701&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/851315729365801701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/851315729365801701'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2008/03/install-mplayer-in-ubuntu710.html' title='Install Mplayer in the Ubuntu7.10'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8664155596809442152</id><published>2007-12-31T15:40:00.000+08:00</published><updated>2007-12-31T16:20:48.603+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Some Thread &amp; concurrency concepts</title><content type='html'>Some good links to explain the some Thread &amp;amp; concurrency concepts.&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://www.cs.mtu.edu/%7Eshene/NSF-3/e-Book/FUNDAMENTALS/thread-management.html"&gt;Thread join,yeild,suspend and resume&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2. &lt;a href="http://www.cs.mtu.edu/%7Eshene/NSF-3/e-Book/MUTEX/locks.html"&gt;Mutual exclusion locks: mutex&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;a href="http://www.cs.mtu.edu/%7Eshene/NSF-3/e-Book/SEMA/basics.html"&gt;semaphores&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. &lt;a href="http://www.cs.mtu.edu/%7Eshene/NSF-3/e-Book/RACE/overview.html"&gt;Race Conditions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5. &lt;a href="http://www.cs.mtu.edu/%7Eshene/NSF-3/e-Book/MONITOR/basics.html"&gt;Monitor&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;6. &lt;a href="http://www.cs.mtu.edu/%7Eshene/NSF-3/e-Book/CH/basics.html"&gt;Channel. (synchronous, asynchronous)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://www.cs.mtu.edu/%7Eshene/NSF-3/e-Book/index.html"&gt;http://www.cs.mtu.edu/~shene/NSF-3/e-Book/index.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8664155596809442152?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8664155596809442152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8664155596809442152&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8664155596809442152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8664155596809442152'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/12/good-links-about-thread-concurrency.html' title='Some Thread &amp; concurrency concepts'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6010535542696649748</id><published>2007-12-21T00:00:00.000+08:00</published><updated>2007-12-21T00:15:15.406+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Getting started with Ubuntu for a window's user.</title><content type='html'>After played with ubuntu about a month, it is time to write an entry about alternative softwares from Windows.&lt;br /&gt;1. Mail: use thunderbird mail client. If you use the Gmail client, that is ok.&lt;br /&gt;2. Chinese input: use the SCIM, but make sure you are using the scim-bridge, otherwise, the scim is conflict with Opera, skype and so on.&lt;br /&gt;3. Text Editor: gedit, vim, Emacs. vi for updating some config file is very handy, I like X-emacs, and is learning it now. try to use Emacs to replace the gedit.&lt;br /&gt;4. IM client: use the Pidgin, it supports QQ, MSN, Yahoo &amp;amp; AIM.&lt;br /&gt;5. Browser: Firefox, Opera, but for myself, use firefox most of time.&lt;br /&gt;6. Notes: Tomboy Notes, this little software is very handy, it helps you make note very easy, and it can export the content to a HTML page, which contains all of notes in a page with some anchors.&lt;br /&gt;7. PDF reader: kpdf&lt;br /&gt;8. CHM reader: xchm.&lt;br /&gt;9. office: open office.&lt;br /&gt;10. Install samba to access the window's shared files or printers.&lt;br /&gt;11. Install vsftpd to create a ftp server.&lt;br /&gt;12. Use eclipse for java coding.&lt;br /&gt;&lt;br /&gt;That is what I used so far, it works perfect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6010535542696649748?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6010535542696649748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6010535542696649748&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6010535542696649748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6010535542696649748'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/12/getting-started-with-ubuntu-for-windows.html' title='Getting started with Ubuntu for a window&apos;s user.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5038506150201238200</id><published>2007-12-20T11:12:00.000+08:00</published><updated>2007-12-20T11:16:02.792+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Subversion'/><title type='text'>subversion quick reference</title><content type='html'>See Johnny's &lt;a href="http://blogs.tech-recipes.com/johnny/subversion-quick-reference"&gt;this blog entry&lt;/a&gt;. It is very useful if you don't use the GUI such as tortoise in windows.&lt;br /&gt;&lt;br /&gt;one more note on this is that you can export SVN_EDITOR=your favorite text editor, and then when you run:&lt;br /&gt;svn ci&lt;br /&gt;it opens up your specified the editor to input your commit comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5038506150201238200?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/5038506150201238200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=5038506150201238200&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5038506150201238200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5038506150201238200'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/12/subversion-quick-reference.html' title='subversion quick reference'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-923396699283309604</id><published>2007-12-03T16:38:00.001+08:00</published><updated>2008-03-14T20:10:13.154+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Switching to use Ubuntu Linux</title><content type='html'>Recently, I am switching to use the Ubuntu 7.10 Linux, and am working fully on this OS on daily basis. I've tried to switch to ubuntu couple months ago, it was using the Ubuntu7.04, but am back to Windows quite soon, it seems I am a bit stuck of linux, that is because I am using linux with windows' habits &amp;amp; minds.&lt;br /&gt;&lt;br /&gt;If you want to use the Ubuntu or other linux distro in Windows way, I'd bet you would be back to Windows at last.. If you want to use linux &amp;amp; love it.. You will have following thoughts on your mind:&lt;br /&gt;&lt;br /&gt;1. Like the free software very much, and try to pass it on.&lt;br /&gt;2. Try to be unique.&lt;br /&gt;3. To be truly tolerant. (You will encounter some softwares that do not support in the Linux, you need to be tolerant or to hack it by yourself).&lt;br /&gt;4. Like to be hacking code.&lt;br /&gt;&lt;br /&gt;The best benefit that you are using linux is that it opens everything to me, no hidings. The open spirit...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-923396699283309604?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/923396699283309604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=923396699283309604&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/923396699283309604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/923396699283309604'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/12/switching-to-use-ubuntu-linux.html' title='Switching to use Ubuntu Linux'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-3207033306158715400</id><published>2007-11-22T17:36:00.000+08:00</published><updated>2007-11-22T19:42:30.198+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JMS'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JMS introduction - part 2.</title><content type='html'>From the &lt;a href="http://jeffyuchang.blogspot.com/2007/11/jms-introduction.html"&gt;first part of JMS introduction&lt;/a&gt;, we have a basic idea of how to operate the message to broker. In this entry, I am going to talk about some advanced feature for JMS.&lt;br /&gt;They are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;1. Transactional operations&lt;br /&gt;&lt;/li&gt;&lt;li&gt;2. Security&lt;/li&gt;&lt;li&gt;3. Reliability&lt;/li&gt;&lt;li&gt;4. Distributed Message.&lt;/li&gt;&lt;li&gt;5. Message Selector&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Some JMS term exploring:&lt;br /&gt;&lt;br /&gt;1. Persistent &amp;amp; MessageDelivery&lt;br /&gt;&lt;br /&gt;By default, we can consider "broker" as a message repository, but sometimes, we want to make sure our message is delivered ONLY_ONCE, and we want our messages still available even our broker crashed. For activeMQ case, there is a "persistent" property in the broker.&lt;br /&gt;&lt;br /&gt;There is also a term called "MessageDelivery", it means whether this message need to be persistent or not. The main difference is that if you are using persistent delivery, messages are persisted to disk/database so that they will survive a broker restart. When using non-persistent delivery, if you kill a broker then you will lose all in-transit messages. [R1]&lt;br /&gt;&lt;br /&gt;2. Acknowledge. (Recovery &amp;amp; Redelivery)&lt;br /&gt;• AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE - the message will be immediately redelivered. The number of times a JMS provider will redeliver the same message before giving up is provider-dependent. The JMSRedelivered message header field will be set for a message redelivered under these circumstances.&lt;br /&gt;• CLIENT_ACKNOWLEDGE - the next message for the listener is delivered. If a client wishes to have the previous unacknowledged message redelivered, it must manually recover the session.&lt;br /&gt;• Transacted Session - the next message for the listener is delivered. The client can either commit or roll back the session (in other words, a RuntimeException does not automatically rollback the session).&lt;br /&gt;&lt;br /&gt;3. Durable &amp;amp; non-durable subscriber.&lt;br /&gt;Queues retain all messages sent to them until the messages are consumed or until the messages  expire. while in Topic, There is a timing dependency between publishers and non-durable subscribers, because a client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages.&lt;br /&gt;A durablesubscriber registers a durable subscription with a unique identity that is retained by JMS. Subsequent subscriber objects with the same identity resume the subscription in the state it was left in by the prior subscriber. If there is no active subscriber for a durable subscription, JMS retains the subscription’s messages until they are received by the subscription or until they expire.&lt;br /&gt;&lt;br /&gt;4.Transaction&lt;br /&gt;&lt;br /&gt;There are two kind of transactions here: client -&gt; broker &amp;amp; client -&gt; broker -&gt; client. In the JMS API, it just defines the former one. the latter one should be a two-phase commit transaction. Transaction was controlled by Session Object, it is very like Database's Connection, by using commit or rollback at last.&lt;br /&gt;&lt;br /&gt;5. Message Selector&lt;br /&gt;As we talked before, the broker holds the queue or topic, which holds the messages, so many messages, we need to define a criteria to select some appropriate messages that we are interested, here comes the MessageSelector, it uses SQL-92 compliant syntax, one thing to note is that it just selector the MessageHeader &amp;amp; Message Properties, not include the MessageBody.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;1. &lt;a href="http://activemq.apache.org/what-is-the-difference-between-persistent-and-non-persistent-delivery.html"&gt;ActiveMQ's message delivery&lt;/a&gt;&lt;br /&gt;2. JMS_1.1_specification&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-3207033306158715400?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/3207033306158715400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=3207033306158715400&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3207033306158715400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/3207033306158715400'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/jms-introduction-part-2.html' title='JMS introduction - part 2.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4778113899791401746</id><published>2007-11-22T16:03:00.001+08:00</published><updated>2008-07-27T14:57:00.621+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JMS'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JMS introduction</title><content type='html'>JMS(Java Messaging System)&lt;br /&gt;&lt;br /&gt;Firstly, we will split this into three categories:&lt;br /&gt;1. JMS client.&lt;br /&gt;2. JMS API.&lt;br /&gt;3. JMS provider.&lt;br /&gt;&lt;br /&gt;Franky, I am quite confused about this when I first get touched on this subject, but after I compared JMS to JDBC, then all things become more clear, and easy to understand. we can think JMS provider as the database vendor, such as Oracle, Mysql etc. the JMS API is similar to the JDBC API, which is used to define a uniform interface to operate Message. The invocation should be like:&lt;br /&gt;&lt;blockquote&gt;   JMS client -&gt; JMS API -&gt; JMS Provider.&lt;/blockquote&gt;&lt;br /&gt;In this entry, I am going to focus on the JMS API, since that's the developer most care about. before doing that, I am going to say a few words on the JMS Provider.&lt;br /&gt;1. In the JMS world, we call the "JMS provider" as "message broker".&lt;br /&gt;2. Message broker can be started as a standalone, or could be embedded too.&lt;br /&gt;&lt;br /&gt;OK, just like the database, after you installed the database, you need to create the database instance, and the connection configuration, so that client can access the database by using JDBC API. so does JMS. but in the JMS world, it is called administered object. they are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;ConnectionFactory - This is the object a client uses to create a connection with a provider.&lt;/li&gt;&lt;li&gt;Destination - This is the object a client uses to specify the destination of messages it is sending and the source of messages it receives.&lt;/li&gt;&lt;/ul&gt;One thing that is very different from database world, it is that in the Messaging world, they are two messaging style(Domain): they are PTP (point-to-point) and Pub/Sub(Publisher-subscriber). The difference between these two styles are: in PTP, one message just can be consumed by ONE consumer; while in the Pub/Sub, a message can be consumed by Multiple consumers.&lt;br /&gt;So you would see two separate APIs for PTP and Pub/Sub respectively in the JMS API, I will use the common one in my next of this entry.&lt;br /&gt;&lt;br /&gt;In the database world, we are operating data in database record as a basis, in the JMS, we are using a javax.jms.Message as a basis. Right now, it has 5 subclass of this class, which supports Text,Object,Stream,Map,Byte as transmit unit. In this Message model, it is consist of Message Header, Message Properties, Message body.&lt;br /&gt;&lt;br /&gt;Developers can retrieve/update data from JDBC API, so does JMS API, developers can produce(publish)/consume(subscribe) data, which is Message, from JMS API.  In order to be a producer or consumer, you need to obtain below two objects.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Connection: A JMS Connection is a client’s active connection to its JMS provider. It will typically allocate provider resources outside the Java virtual machine. A Connection is a factory for Sessions that use its underlying connection to a JMS provider for producing and consuming messages.&lt;/li&gt;&lt;li&gt;Session: A JMS Session is a &lt;span style="color: rgb(255, 0, 0);"&gt;single-threaded&lt;/span&gt; context* for producing and consuming messages. Although it may allocate provider resources outside the Java virtual machine, it is considered a lightweight JMS object.&lt;/li&gt;&lt;/ul&gt;and then you can create producer or consumer from Session &amp;amp; Destination Objects. For the consumer, it has two consuming style: Synchronous &amp;amp; Asynchronous.&lt;br /&gt;&lt;br /&gt;A simple example for producing a message using ActiveMQ.(A JMS provider):&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;            // Create the connection.&lt;br /&gt;          ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, password, url);         &lt;br /&gt;          connection = connectionFactory.createConnection();&lt;br /&gt;          connection.start();&lt;br /&gt;       &lt;br /&gt;          // Create the session&lt;br /&gt;          Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);&lt;br /&gt;              destination = session.createQueue(subject);&lt;br /&gt;       &lt;br /&gt;          // Create the producer.&lt;br /&gt;          MessageProducer producer = session.createProducer(destination);&lt;br /&gt;           producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);&lt;br /&gt;                   &lt;br /&gt;          // Start sending messages&lt;br /&gt;         TextMessage message = session .createTextMessage();&lt;br /&gt;           message.setText("producing message");&lt;br /&gt;        producer.send(message);&lt;br /&gt;   &lt;br /&gt;//Closing resources, it is better put this in finally block.&lt;br /&gt;        session.close();&lt;br /&gt;       connection.close();&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;Reference&lt;br /&gt;1. &lt;a href="http://www.javapassion.com/j2ee/JMS_speakernoted.pdf"&gt;JMS slides from javapassion.com&lt;/a&gt; (Highly recommend).&lt;br /&gt;2. &lt;a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bncdq.html"&gt;Java messaging service API from JavaEE 5 tutorial&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4778113899791401746?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4778113899791401746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4778113899791401746&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4778113899791401746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4778113899791401746'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/jms-introduction.html' title='JMS introduction'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4282325555399965300</id><published>2007-11-18T19:22:00.000+08:00</published><updated>2007-11-18T22:25:44.671+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Guice'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Guice simplicity impressed me.</title><content type='html'>Today, I've tried a simple sample with &lt;a href="http://code.google.com/p/google-guice/"&gt;Guice&lt;/a&gt;, it reduces a lot configuration compares to spring's xml config. Firstly, I am a bit of worrying using annotation too much would make code a bit messy, it would be a bit hard to read with a lot of annotation, that fact is that with Guice, it is not too much annotation, we can consider it is sort of javadoc, and just for the resource that you need to inject.&lt;br /&gt;&lt;br /&gt;Compared to spring's xml configuration, it has below advantages (IMHO) :&lt;br /&gt;1. Use the @Inject annotation to define the injections, instead of using xml, for xml configuration, you need to write verbose xml to define the relationship.&lt;br /&gt;2. The string in the xml file is more misspelling than using java code itself, since compiler would tell you that.&lt;br /&gt;3. The most important one is it can make them consistent. It is easy for developers to refactor. Most IDE support that. I mean using java config instead of xml.. not the annotation.&lt;br /&gt;&lt;br /&gt;There is a comprehensive comparison between Guice and Spring &lt;a href="http://code.google.com/p/google-guice/wiki/SpringComparison"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;All in all, its simplicity impressed me, if you are looking for a lightweight DI container, you should check out Guice. It worths you a try.&lt;br /&gt;&lt;br /&gt;PS: Spring also has the spring java config since 2.5 version, haven't got a chance to try it out yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4282325555399965300?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4282325555399965300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4282325555399965300&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4282325555399965300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4282325555399965300'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/guice-rocks.html' title='Guice simplicity impressed me.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-6991763236141942756</id><published>2007-11-18T02:02:00.000+08:00</published><updated>2007-11-18T02:08:46.006+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Guice'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Guice videos</title><content type='html'>Firstly, little background, Bob Lee's famous: &lt;a href="http://crazybob.org/2006/01/i-dont-get-spring.html"&gt;I don't get Spring&lt;/a&gt; thread, and then he created the &lt;a href="http://code.google.com/p/google-guice/"&gt;Guice&lt;/a&gt;, lightweight dependency injection.&lt;br /&gt;&lt;br /&gt;Some Guice introduction videos from youtube. Very interesting, even if you don't want to use guice, it worths you to listen.&lt;br /&gt;1. &lt;a href="http://www.youtube.com/watch?v=8RGhT-YySDY"&gt;Java On Guice: Dependency injection, the Java Way&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.youtube.com/watch?v=l81T1AQWX84"&gt;OSS Speaker Series - Java on Guice&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://www.youtube.com/watch?v=x_NpraeC3tk"&gt;Google Developer Day Beijing-Guice,Java Dependency Injection&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-6991763236141942756?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/6991763236141942756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=6991763236141942756&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6991763236141942756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/6991763236141942756'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/guice-videos.html' title='Guice videos'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-4479353328506491548</id><published>2007-11-18T01:02:00.000+08:00</published><updated>2007-11-18T02:23:55.029+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Spring 2.x IOC exploring</title><content type='html'>OK, Lets see how the IOC (DI) module move forward in the spring 2.x version.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;XML configuration extensions.&lt;br /&gt;&lt;br /&gt;I would say this enhancement make the third-party library, which build on spring's IOC container, a lot of easier for the configuration. Such as Apache CXF, Apache Activemq and so on. Personally, I would consider this is a big improvement for the configuration, and integration with other libraries.&lt;br /&gt;Adding a custom xml configuration typically has below four steps:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Authoring an xml schema to describe your custom element(s).&lt;/li&gt;&lt;li&gt;Coding a custom NameSpaceHandler implementation.&lt;/li&gt;&lt;li&gt;Coding one or more BeanDefinitionParser implementation. (This is the real job that need to be done. populate the data from xml file).&lt;/li&gt;&lt;li&gt;Registering the above artifact with spring.&lt;/li&gt;&lt;/ul&gt;The most real job is parsing the xml in the BeanDefinitionParser class, and get the data from xml to bean.&lt;br /&gt;&lt;br /&gt;The spring's registering way is an inspiration of how we can register the stuff modularly, instead of putting all of configuration file in one center place, we can split them in its own module, but with the same relative path, such as /META-INF/spring/spring.handlers for spring's example.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;New Bean scopes.&lt;br /&gt;In the Spring1.x IOC module, it just has two scope:the singleton and non-singleton, it is way too coarse-grain. In the 2.x version, it adds more scopes, like Session scope, Request scope etc..it also has custom scope.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Spring Java config.&lt;br /&gt;To be specific, this is introduced by the spring2.5.. I am gonna try this later and give it a comparison with &lt;a href="http://code.google.com/p/google-guice/"&gt;Guice&lt;/a&gt; in next couple entries..&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Reference&lt;br /&gt;1. &lt;a href="http://static.springframework.org/spring/docs/2.0.x/reference/extensible-xml.html"&gt;Spring 2.x extensible xml explanation&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.memestorm.com/blog/spring-components-xml-configuration-on-steroids/"&gt;spring-components-xml-configuration-on-steroids (example)&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://www.infoq.com/articles/spring-2-intro"&gt;Spring2.o Intro&lt;/a&gt; (Posted at InfoQ)&lt;br /&gt;4. &lt;a href="http://cwiki.apache.org/CXF20DOC/configuration-for-developers.html"&gt;How CXF configuration works&lt;/a&gt;&lt;br /&gt;5. &lt;a href="http://static.springframework.org/spring-javaconfig/docs/1.0-m2a/reference/html/"&gt;Spring Java config reference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-4479353328506491548?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/4479353328506491548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=4479353328506491548&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4479353328506491548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/4479353328506491548'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/spring-2x-ioc-exploring.html' title='Spring 2.x IOC exploring'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2502362596623787203</id><published>2007-11-17T00:56:00.000+08:00</published><updated>2007-11-17T01:38:42.093+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Thoughts'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Is it a bad idea to reply on Spring too much?</title><content type='html'>Since spring is more and more powerful &amp;amp; popular, to some extent, it becomes the de facto JEE application's infrastructure, so a lot of projects in the open source area(Apache CXF, Apache Servicemix ...) use spring as its basic configuration &amp;amp; bean management... some of my colleagues said it was a bad idea that we rely on spring too much. I don't so, reasons are:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Spring is open source, we can see how it gets the job done, we know how it works, we can modify it as what we want.&lt;/li&gt;&lt;li&gt;Take Apache CXF for example, since now a lot of people are using spring, it is not a good idea to create another XSD or DTD to ask people to learn for configuration, always remember people are lazy, we need to reduce the learning curve. Since spring did a good job, at least, if you want to write a new one, you need to specify where the spring configuration can't meet your requirement..&lt;/li&gt;&lt;li&gt;Some people think relying on spring too much, maybe one day, we will lose our place, since interface21 people (which create and provide support for spring) will take over our product... I don't agree with it, spring is good at one place, but it doesn't mean that they are good at everything, or they do not have time to take everything... look how eclipse and those eclipse plug-ins work together..&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;All in all, I don't think rely on spring too much is a bad thing, instead, I think we need to adopt those good libraries, not to write a new one simply because we are afraid that we might lose our place.. remember, open source software means you can see how codes work, you can change them.. Successful people always stand on a giant...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2502362596623787203?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2502362596623787203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2502362596623787203&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2502362596623787203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2502362596623787203'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/is-it-bad-idea-to-reply-on-spring-too.html' title='Is it a bad idea to reply on Spring too much?'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-5078901634000890314</id><published>2007-11-16T23:15:00.000+08:00</published><updated>2007-11-17T01:37:27.133+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Spring 1.2.x IOC exploring</title><content type='html'>Spring uses bean factory to manage the application beans.  what we most uses is using the xml config file to define the beans dependency and initializations..&lt;br /&gt;&lt;br /&gt;Here I do not want to elaborate the whole config thing, there are a lot of material in the Internet and Reference, which did a better job than me, I just want to list some features that you might not use that often, and might don't know it yet.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Bean's auto-wiring. (By Name, By Type, Construcotor, auto-detect).. but here I think it is better for us to wire beans explicitly. But if you are a COC fan, then you might be like this functionality.&lt;/li&gt;&lt;li&gt;Bean creation by static factory method or by instance factory method. In most of cases, we are using bean creation by constructor, but for legacy codes integration, we might need the other two options.&lt;/li&gt;&lt;li&gt;Method Injection, by using look-up method Injection &amp;amp; arbitrary method replacement.&lt;/li&gt;&lt;li&gt;"depends-on" attribute, in case there is a bean rely on other bean's initialization.&lt;/li&gt;&lt;li&gt;Lifecycle interfaces. (InitializatingBean, DisposableBean) or using init-method, destory-method in config file.&lt;/li&gt;&lt;li&gt;Aware-suffix interface, such as BeanFactoryAware, ApplicationContextAware... if you want to get the BeanFactory or ApplicationContext object in your bean, such as publish events in the applicationContext, you can implement *Aware interface to get it. Spring will populate the context to your bean.&lt;/li&gt;&lt;li&gt;FactoryBean. This one is quite easy to get confused by the BeanFactory at first glance. They are totally different.. BeanFactory is managing beans.. FactoryBean just take charges of creating a bean. Remember in most cases, we are creating a bean via constructor..what if we want to create a proxy class, which target is the bean's instance.. Then implements the FactoryBean's interface to do that. (commonly, it is used in the spring's library itself, such as AOP proxy class, JndiObjectFactoryBean and so on.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;1. &lt;a href="http://static.springframework.org/spring/docs/1.2.x/reference/beans.html"&gt;Spring 1.2.x Reference&lt;/a&gt;&lt;br /&gt;2. &amp;lt;&amp;lt;Expert one-on-one Design and Development&amp;gt;&amp;gt; chapter 11.&lt;br /&gt;3. &lt;a href="http://www.javapassion.com/j2ee/#Spring_Framework_Dependency_Injection"&gt;Java Passion Free course&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-5078901634000890314?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/5078901634000890314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=5078901634000890314&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5078901634000890314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/5078901634000890314'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/spring-12x-ioc-concluded.html' title='Spring 1.2.x IOC exploring'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8746793970092906667</id><published>2007-11-16T00:32:00.003+08:00</published><updated>2008-03-31T16:20:37.988+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OSGi'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Simply wrap a jar as a bundle</title><content type='html'>If you need to wrap a jar to be a bundle, you can use the felix maven bundle, just uses the &amp;lt; Import-Package &amp;gt; and &amp;lt; Export-Package &amp;gt; if will help you get the job done.. quite simple..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8746793970092906667?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8746793970092906667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8746793970092906667&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8746793970092906667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8746793970092906667'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/simply-create-bundle-for-jar.html' title='Simply wrap a jar as a bundle'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-1952789382083297588</id><published>2007-11-14T23:25:00.000+08:00</published><updated>2007-11-14T23:29:08.541+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>Weak,Soft,Strong Reference In Java</title><content type='html'>Do not know Weak, Soft, Strong Reference concept in Java...&lt;br /&gt;Here you go:&lt;br /&gt;1.&lt;a href="http://blog.centuryminds.com/2007/11/10/weak-and-soft-references-in-java/"&gt; Weak and Soft Reference In Java&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-1952789382083297588?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/1952789382083297588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=1952789382083297588&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1952789382083297588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/1952789382083297588'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/weaksoftstrong-reference-in-java.html' title='Weak,Soft,Strong Reference In Java'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-8404288403746747412</id><published>2007-11-14T00:50:00.002+08:00</published><updated>2008-03-31T16:20:49.927+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OSGi'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Packaging OSGi bundle.</title><content type='html'>It is tedious for you to write the Import-Package, Export-Package directly in the MENIFEAST.MF file... Here is a &lt;a href="http://felix.apache.org/site/maven-bundle-plugin-bnd.html"&gt;felix maven plugin&lt;/a&gt; that helps you make life easier.&lt;br /&gt;&lt;br /&gt;Today, talked with &lt;a href="http://gnodet.blogspot.com/"&gt;Guillaume&lt;/a&gt; , it makes me know clear and more about the packaging OSGi bundle options.&lt;br /&gt;&lt;br /&gt;1.&amp;lt;Export-Package&amp;gt;. (It is detailed explained in the Reference 1).&lt;br /&gt;2.&amp;lt; Private-Package&amp;gt;: it will actually "merge" (copied) the jars and include in the bundle you are creating all the packages referenced.&lt;br /&gt;3. &amp;lt; Import-Package&amp;gt; If you want to import something as optional, use the syntax as: javax.jmdns*;resolution:=optional,&lt;br /&gt;4. &amp;lt;Spring-Context&amp;gt; This option is for spring-OSGi, it specified where spring config file need to load, and some other spring-osgi attributes, such as: create-asynchronously etc, take "publish-context" for example, if we specify the "publish-context := fasle", then you registered some bean in the registry, meanwhile, in the test case, you use the "waitOnContextCreation()" method, you would get a timeout error.&lt;br /&gt;&lt;br /&gt;5. If you want to test the configuration admin functionalities, you need to install below 3 bundles:&lt;br /&gt;1) org.apache.felix:org.apache.felix.configadmin&lt;br /&gt;2) org.apache.felix:org.osgi.compendium&lt;br /&gt;3) org.apache.geronimo.specs:geronimo-servlet_2.5_spec&lt;br /&gt;&lt;br /&gt;6. If you install a bundle, you get below error message:&lt;br /&gt;&lt;blockquote&gt;Missing Constraint: Import-Package: *; version="0.0.0"&lt;/blockquote&gt;&lt;br /&gt;It means you are missing libraries dependency in the pom file.&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;1. &lt;a href="http://felix.apache.org/site/maven-bundle-plugin-bnd.html"&gt;Felix maven pulgin info&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://www.aqute.biz/Code/Bnd"&gt;BND tool&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-8404288403746747412?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/8404288403746747412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=8404288403746747412&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8404288403746747412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/8404288403746747412'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/packaging-osgi-bundle.html' title='Packaging OSGi bundle.'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-2421152960852901884</id><published>2007-11-13T01:32:00.000+08:00</published><updated>2007-11-13T01:44:17.347+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CXF'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>IMS rolled out its 0.1 version</title><content type='html'>I created a little project at &lt;a href="http://code.google.com/p/blogging/"&gt;Google Code&lt;/a&gt;, it rolled out its 0.1 version in 5 Nov 2007.. In this release, it demonstrates below functionalities (copied from release note)..&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ims-core module&lt;/span&gt;&lt;ol&gt;&lt;li&gt;Using JAXWS + JAXB (CXF runtime) to publish web service. &lt;/li&gt;&lt;li&gt;Using Spring acegi as web service authorization. &lt;/li&gt;&lt;li&gt;Using ws-security (plain password) as authentication. &lt;/li&gt;&lt;li&gt;Using Spring AOP transaction. &lt;/li&gt;&lt;li&gt;Using DBUnit to do the dao unit test. &lt;/li&gt;&lt;li&gt;Using easymock to do the service layer unit test. &lt;/li&gt;&lt;li&gt;Using cxf local transport to do the web service unit test. &lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;ims-web module&lt;/span&gt;&lt;ol&gt;&lt;li&gt;Using CXF wsdl2java (codegen tool) to generate the stub. &lt;/li&gt;&lt;li&gt;Using JAXWS customization to use the java.util.Date instead of XMLGregorianCalendar. &lt;/li&gt;&lt;li&gt;Using JAXWS + JAXB (CXF runtime) to access the web service. &lt;/li&gt;&lt;li&gt;Using Spring acegi web application filter and Jcaptcha as security implementation. &lt;/li&gt;&lt;li&gt;Using div + css as layout design implementation. &lt;/li&gt;&lt;/ol&gt;You can download the source code from &lt;a href="http://blogging.googlecode.com/files/ims-0.1-src.zip"&gt;here&lt;/a&gt;, since its war size is about 20M, I don't provide it in the website, you need to refer to the README.txt in the source code to build it, it is quite straightforward to get it working.. (actually you just need to set up database manually, and then update the database connection config file appropriately).&lt;br /&gt;&lt;br /&gt;I've also created some tasks for 0.2 release or future in the &lt;a href="http://code.google.com/p/blogging/issues/list"&gt;issue page&lt;/a&gt;, if you want to join this project, drop me a mail, (or add a comment here), I would add you as a commiter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-2421152960852901884?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/2421152960852901884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=2421152960852901884&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2421152960852901884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/2421152960852901884'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/ims-rolled-out-its-01-version.html' title='IMS rolled out its 0.1 version'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15125903.post-7877351179877615140</id><published>2007-11-11T03:21:00.000+08:00</published><updated>2007-11-11T04:17:56.483+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAVA'/><title type='text'>JNDI introduction</title><content type='html'>If you are using EJB, you must be familiar with JNDI concept, since if you want to find a EJB Remote Object, you need to obtain the object through JNDI..&lt;br /&gt;Yes, I know JNDI, it is a naming service and directory service for EJB, that was my original thought and understanding on JNDI. JNDI is so simple that I could imagine that and I don't even need to take a look at some related materials on it, we can get its meaning from the name itself. So it gives me an impression that the JNDI is belonged to the EJB, if you want to use JNDI, you need to start the EJB container, which I really don't like to do that today. (I'm a POJO fans, the deploy-redeploy cycle test is really a time-consuming, low productivity stuff).&lt;br /&gt;&lt;br /&gt;Today, I am looking on the JMS stuff, which I need to talk with JNDI again, from my original understanding, I need to start the EJB container to use JNDI, then I found the tutorial[1] from SUN, and then I found my original understanding was wrong, JNDI is not belonged to EJB, we just can say EJB uses JNDI by providing RMI JNDI spi.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The JNDI offer two functionalities:&lt;br /&gt;1. Name &amp;amp; Naming service.&lt;br /&gt;2. Directory &amp;amp; Directory Service.&lt;br /&gt;&lt;br /&gt;It is also involved with two Interfaces:&lt;br /&gt;1. API. Application Programming Interface.&lt;br /&gt;2. SPI: Service Providing Interface.&lt;br /&gt;&lt;br /&gt;So, for the EJB case, it provides the RMI as SPI implementation; for the JMS case, its implementation, such as ActiveMQ, will provide the JNDI SPI implementation.&lt;br /&gt;&lt;br /&gt;Lets see how we get a Object from JNDI typically:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; Hashtable env = new Hashtable();&lt;br /&gt;env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");&lt;br /&gt;Context ctx = new InitialContext(env);&lt;br /&gt;Object obj = ctx.lookup(name);&lt;br /&gt;System.out.println(name + " is bound to: " + obj);&lt;br /&gt;ctx.close();&lt;/pre&gt;We set the "INITIAL_CONTEXT_FACTORY" in the environment, which is the SPI's implementation's class. we might need to set other properties that the SPI's implementation need through the "key-value" in the environment, such as provider url, username, password etc.&lt;br /&gt;&lt;br /&gt;Reference&lt;br /&gt;1: &lt;a href="http://java.sun.com/products/jndi/tutorial/trailmap.html"&gt;Sun's JNDI tutorial&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15125903-7877351179877615140?l=jeffyuchang.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jeffyuchang.blogspot.com/feeds/7877351179877615140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15125903&amp;postID=7877351179877615140&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7877351179877615140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15125903/posts/default/7877351179877615140'/><link rel='alternate' type='text/html' href='http://jeffyuchang.blogspot.com/2007/11/jndi-introduction.html' title='JNDI introduction'/><author><name>Jeff Yu   (余昌)</name><uri>http://www.blogger.com/profile/09118191450334995303</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://4.bp.blogspot.com/_4KnaH_XIr1w/SloGpQLyfmI/AAAAAAAABe0/eWHnOI-yAHM/S220/jeff_new.gif'/></author><thr:total>0</thr:total></entry></feed>
