赶时髦,也写写博客
yinyousong · 共 47 篇文章
Jpa-hibernate-spring and compass search enginer
初始化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 { Thread.sleep(lazySecond * 1000)…
2009-10-21 15:11 · compass · 评论(0)
EntityBeanSet
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 * */ class EntityBeanSet extend…
2009-09-23 17:08 · seam contexts · 评论(0)
EntityBeanMap
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 AbstractEntityBeanCollectio…
2009-09-23 17:07 · seam contexts · 评论(0)
EntityBeanList
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 King * */ class Enti…
2009-09-23 17:03 · seam contexts · 评论(0)
AbstractEntityBeanCollection
以容器方式保存钝化是EntityBeans package org.jboss.seam.contexts; abstract class AbstractEntityBeanCollection implements Wrapper { private transient boolean initialized; //是否初始化 protected AbstractEntityBeanCollection() { initialized = true; } public final void activate() { //if all passivatedentities not null…
2009-09-23 16:59 · seam contexts · 评论(0)
EntityBean
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 context at * the …
2009-09-23 16:38 · seam contexts · 评论(0)
PassivatedEntity
注意: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; import org.jboss.se…
2009-09-23 16:25 · seam contexts · 评论(0)
ComponentType
有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 components und…
2009-09-23 15:58 · seam · 评论(0)
ScopeType
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 Seam. * * @author <a href…
2009-09-23 15:56 · seam · 评论(0)
Seam
以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.MESSAGE…
2009-09-23 15:52 · seam · 评论(0)
Entity
继承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.persistence.Id; …
2009-09-23 15:23 · seam · 评论(0)
Model
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; public Model(Class<?> beanClass) { this.beanClas…
2009-09-23 15:05 · seam · 评论(0)
BijectionInterceptor
//$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; import o…
2009-09-22 16:59 · seam core · 评论(0)
JPA cache
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 for large amount of object…
2009-09-22 16:13 · JPA · 评论(0)