public synchronized Store open(String name) throws IOException { MemoryStore store = stores.get(name); if (store == null) { if (timeout <= 0) { store = new MemoryStore(idGenerator); } else { store = new TimeoutMemoryStore(idGenerator, timeout); } stores.put(name, store); } return store; }
/** * {@inheritDoc} * * Before attempting to load the object, all data older than the specified timeout will first be * removed from the store. */ public Object load(String id) throws IOException { evict(); LOG.debug("Loading object with id:" + id); Entry entry = datas.remove(id); return entry == null ? null : entry.data; }
/** * {@inheritDoc} */ public void store(String id, Object data) throws IOException { LOG.debug("Storing object with id: " + id); datas.put(id, new Entry(data)); }
@Override public void start() throws Exception { super.start(); if (closedAggregatesStoreFactory == null) { closedAggregatesStoreFactory = new MemoryStoreFactory(); } closedAggregates = closedAggregatesStoreFactory.open(getService().toString() + getEndpoint() + "-closed-aggregates"); if (reportTimeoutAsErrors && !reportErrors) { throw new IllegalArgumentException( "ReportTimeoutAsErrors property may only be set if ReportTimeout property is also set!"); } }
public void init() throws Exception { try { InitialContext ctx = getInitialContext(); ConnectionFactory connectionFactory = null; connectionFactory = getConnectionFactory(ctx); connection = connectionFactory.createConnection(); connection.start(); // set up the Store if (endpoint.store != null) { store = endpoint.store; } else if (endpoint.storeFactory != null) { store = endpoint.storeFactory.open(endpoint.getService().toString() + endpoint.getEndpoint()); } else { store = new MemoryStoreFactory().open(endpoint.getService().toString() + endpoint.getEndpoint()); } doInit(ctx); } catch (Exception e) { shutdown(); } }
public String store(Object data) throws IOException { String id = idGenerator.generateId(); store(id, data); return id; }
public void start() throws Exception { super.start(); // Create store if (store == null) { if (storeFactory == null) { storeFactory = new MemoryStoreFactory(); } store = storeFactory.open(getService().toString() + getEndpoint()); } }
@PostConstruct public void initialize() throws Exception { if (store == null) { if (storeFactory == null) { storeFactory = new MemoryStoreFactory(); } store = storeFactory.open(getService().toString() + getEndpoint()); } correlation = "TransformBeanSupport.Correlation." + getService() + "." + getEndpoint(); }
/** * Start this endpoint. * * @throws Exception */ public synchronized void activate() throws Exception { super.activate(); if (store == null) { if (storeFactory == null) { storeFactory = new MemoryStoreFactory(); } store = storeFactory.open(getService().toString() + getEndpoint()); } template = createTemplate(); }
@Override protected void init() throws JBIException { super.init(); if (store == null) { if (storeFactory == null) { storeFactory = new MemoryStoreFactory(); } try { store = storeFactory.open(getService().toString() + getEndpoint()); } catch (IOException e) { throw new JBIException("Unable to open storeFactory" + e.getMessage(), e); } } correlation = "TransformComponentSupport.Correlation." + getService() + "." + getEndpoint(); }
public void start() throws Exception { super.start(); if (store == null) { if (storeFactory == null) { storeFactory = new MemoryStoreFactory(); } store = storeFactory.open(getService().toString() + getEndpoint()); } if (lockManager == null) { lockManager = new SimpleLockManager(); } if (timerManager == null) { timerManager = new TimerManagerImpl(); } timerManager.start(); }
public synchronized void activate() throws Exception { super.activate(); if (template == null) { if (isJms102()) { template = new JmsTemplate102(getConnectionFactory(), isPubSubDomain()); } else { template = new JmsTemplate(getConnectionFactory()); } } if (store == null && !stateless) { if (storeFactory == null) { storeFactory = new MemoryStoreFactory(); } store = storeFactory.open(getService().toString() + getEndpoint()); } }