KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > handler > ManagedObjectFlushHandler


1 /*
2  * Copyright (c) 2003-2006 Terracotta, Inc. All rights reserved.
3  */

4 package com.tc.objectserver.handler;
5
6 import com.tc.async.api.AbstractEventHandler;
7 import com.tc.async.api.ConfigurationContext;
8 import com.tc.async.api.EventContext;
9 import com.tc.objectserver.api.ObjectManager;
10 import com.tc.objectserver.context.ManagedObjectFlushingContext;
11 import com.tc.objectserver.core.api.ServerConfigurationContext;
12
13 import java.util.List JavaDoc;
14
15 public class ManagedObjectFlushHandler extends AbstractEventHandler {
16
17   private ObjectManager objectManager;
18
19   public void handleEvent(EventContext context) {
20     ManagedObjectFlushingContext mfc = (ManagedObjectFlushingContext) context;
21     List JavaDoc objects2Flush = mfc.getObjectToFlush();
22     objectManager.flushAndEvict(objects2Flush);
23   }
24
25   public void initialize(ConfigurationContext context) {
26     super.initialize(context);
27     ServerConfigurationContext oscc = (ServerConfigurationContext) context;
28     objectManager = oscc.getObjectManager();
29   }
30
31 }
32
Popular Tags