January 2009
EJB deployment in JBoss (in Chinese)
最近在用EJB3 写一个简单的通讯录,其中EJB3 是由许多部分组成。一个看似简单的通讯录,是通过好多道程序才来实现的。以下是EJB deployment 的解析。 我有付上jboss reference 相关内容:http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch5.chapter.html 有兴趣的人可以作梗深入的探索。
1。当EJB.jar 要开始运行时, jboss deployment 开始扫描,根据jboss_service.xml, jboss deployment 找到运行路径(deploy directory), 之后找出正确的deployer (EJB deployer).
2。然后这个EJB deployer 再找相关的descriptors, annotations 来调试其 EJB container.
3。在这个 EJB container 里, 有 interface, interceptors, Bean (interface 的逻辑, 真正在算的部分), server invoker。 EJB container 会分化出一个 client container.
4。Client container 有interface, interceptors, invoker, 但是没有 Bean. 当client container 被分化后,它马上和 naming service 注册。
Naming service 其实是一个hash table, key 是 interface 的名字, 值是整个client container 的复制。
findinjar.sh
Which jar is the class in?
cat /home/andy/scripts/findinjar.sh
#usage ~/scripts/findinjar.sh directory classname
for jar in $(find $1 -name '*.jar'); do
if unzip -l $jar | grep $2 ; then
echo " found in $jar"
fi
done
For example: ~/scripts/findinjar.sh $JBOSS_HOME/server/default/lib Session
Or: find . -type d -exec $HOME/scripts/findinjar.sh '{}' PortalSession ';' - would find PortalSession class in any jar file located in a sub directory of the current directory.
Authenticate via JNDI over HTTP in JBoss and building/feeding JBossAS
In Weblogic you can authenticate for remote EJB authentication via JNDI like this:
Properties p = new Properties();
p.put(Context.SECURITY_PRINCIPAL, "user");
p.put(Context.SECURITY_CREDENTIALS, "password");
...
InitialContext ctx = new InitialContext(p);
In JBoss you have to do this (official verbose explanation for the bored):
Video Transformation with VirtualDub
I recently shot a bit of video on my still camera. It involved a flag pole, so naturally, I held the camera in portrait orientation. This presented me with an issue when I got the video back home to my desktop. I had shot it sideways, but no one would want to watch it that way, and I had no access to a video lab or the cash to buy video processing software.
Spring Annotations Example application with Ant
I had a lot of trouble with the Annotations example based on the Spring In Action book with regards to its build and dependencies. Rather than debug Maven and keep this POM file up to date, I made an ant-based example. No comment on Maven other than dynamic dependency resolution on an example app leave you wondering what is wrong.
Attached is a new example app based on a Programmer performing Tasks and a project manager talking about them. The only thing you need is a recent ant and java.
Interceptors and Exception Mapping for Appcelerator
I've been working on some code for both OS Integrators, LLC and for a client as well. I'm using the Appcelerator AJAX framework for both projects. In order to accomplish these goals, I've committed the following to head in the service:java component:
- @ExceptionResponses/@ExceptionResponse
- @BeforeMethods
- @AfterMethods
- @InterceptorMethod
For example let's say you have:
Firmware upgrade for the cheapy Blu-Ray player from Target
On the last day of Chanukah, I bought my wife one of these: Olevia Blu-Ray player which is actually this player rebranded. Initially many DVDs and one of the Blu-Ray disks I bought her didn't work.