- 浏览: 43389 次
- 性别:
- 来自: 长沙
最新评论
文章列表
初始化Bean,实现Spring运行加载
public class CompassIndexBuilder implements InitializingBean{
private boolean buildIndex = false;
private int lazySecond =10;
private CompassGps compassGps;
private Thread compassStartThread = new Thread( new Runnable(){
public void run() {
try {
...
- 2009-10-21 15:11
- 浏览 1512
- 评论(0)
package org.jboss.seam.contexts;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Swizzles entities held in the conversation context at
* the end of each request.
*
* @see PassivatedEntity
*
* @author Gavin King
*
*/ ...
- 2009-09-23 17:08
- 浏览 805
- 评论(0)
package org.jboss.seam.contexts;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* Swizzles entities held in the conversation context at
* the end of each request.
*
* @see PassivatedEntity
*
* @author Gavin King
*
*/
class EntityBeanMap extends ...
- 2009-09-23 17:07
- 浏览 837
- 评论(0)
package org.jboss.seam.contexts;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Swizzles entities held in the conversation context at
* the end of each request.
*
* @see PassivatedEntity
* 以List方式实现AbstractEntityBeanCollecton
* @author Gavin ...
- 2009-09-23 17:03
- 浏览 627
- 评论(0)
以容器方式保存钝化是EntityBeans
package org.jboss.seam.contexts;
abstract class AbstractEntityBeanCollection implements Wrapper
{
private transient boolean initialized; //是否初始化
protected AbstractEntityBeanCollection()
{
initialized = true;
}
public final void activ ...
- 2009-09-23 16:59
- 浏览 765
- 评论(0)
EntityBean 主要用来保存一个Entity的对象,同时操作PassivateEntity对保存的实体进行钝化或者激活.
也可以说是对EntityBean的包装,当对一个EntityBean包装时,便可以对此Entity进行精确的version控制
package org.jboss.seam.contexts;
import static org.jboss.seam.contexts.PassivatedEntity.passivateEntity;
/**
* Swizzles entities held in the conversation cont ...
- 2009-09-23 16:38
- 浏览 773
- 评论(0)
注意:PersistenceContext未确切了解,是否是每个钝化对象对应一个,是否是跟线程Contexts有关.
应该是跟线程Contexts关联,因为可能有多个数据源
package org.jboss.seam.contexts;
import java.io.Serializable;
import javax.persistence.EntityManager;
import org.hibernate.Session;
import org.jboss.seam.Component;
import org.jboss.seam.Seam;
...
- 2009-09-23 16:25
- 浏览 789
- 评论(0)
有4中bean EJB规范3中 Entity JAVA_BEAN
//$Id: ComponentType.java 5355 2007-06-20 20:42:22Z gavin $
package org.jboss.seam;
import static org.jboss.seam.ScopeType.CONVERSATION;
import static org.jboss.seam.ScopeType.EVENT;
import static org.jboss.seam.ScopeType.STATELESS;
/**
* The types of ...
- 2009-09-23 15:58
- 浏览 964
- 评论(0)
ScopeType与Context相关
/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.seam;
import org.jboss.seam.contexts.Context;
import org.jboss.seam.contexts.Contexts;
/**
* The scopes defined by S ...
- 2009-09-23 15:56
- 浏览 1194
- 评论(0)
以Key-组件Class Value-组件@Name内的名称,名称缓存
同时缓存EJB部署描述符及EJB类加载器
//$Id: Seam.java 10262 2009-04-01 07:03:21Z dan.j.allen $
package org.jboss.seam;
import static org.jboss.seam.ComponentType.ENTITY_BEAN;
import static org.jboss.seam.ComponentType.JAVA_BEAN;
import static org.jboss.seam.ComponentType ...
- 2009-09-23 15:52
- 浏览 1446
- 评论(0)
继承Model,以Key-name Value-class保存Entity,统一保存在ApplicationContext中
Entity主要是保存@Entity的生命周期方法以及Entity的名称.
package org.jboss.seam;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import javax.persistence.EmbeddedId;
import javax ...
- 2009-09-23 15:23
- 浏览 1732
- 评论(0)
Seam中含有三种组建
1.Model 2.Entity 3.Component 2继承1 3继承1
Seam中的内部对象不是为Mode就是Entity
用Model可以包装@Name标记的类Class
同时Component继承Model,对Class进行一些复杂的处理
package org.jboss.seam;
import org.jboss.seam.contexts.Contexts;
public class Model
{
private Class<?> beanClass;
pu ...
- 2009-09-23 15:05
- 浏览 787
- 评论(0)
//$Id: BijectionInterceptor.java 9561 2008-11-14 03:26:13Z dan.j.allen $
package org.jboss.seam.core;
import java.util.concurrent.locks.ReentrantLock;
import org.jboss.seam.Component;
import org.jboss.seam.CyclicDependencyException;
import org.jboss.seam.annotations.intercept.AroundInvoke; ...
- 2009-09-22 16:59
- 浏览 881
- 评论(0)
PersistenceContext Level2 Cache Extend PersistenceContext .
二级缓存优缺点The advantages of L2 caching are:
* avoids database access for already loaded entities
* faster for reading frequently accessed unmodified entities
The disadvantages of L2 caching are:
* memory consumption ...
- 2009-09-22 16:13
- 浏览 1205
- 评论(0)