01: /*
02: * Copyright (c) 2003-2006 Terracotta, Inc. All rights reserved.
03: */
04: package com.tc.objectserver.handler;
05:
06: import com.tc.async.api.AbstractEventHandler;
07: import com.tc.async.api.ConfigurationContext;
08: import com.tc.async.api.EventContext;
09: 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;
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 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: }
|