]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/TransientCacheListener.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / procedure / adapter / TransientCacheListener.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.common.procedure.adapter;\r
13 \r
14 import org.simantics.db.procedure.Listener;\r
15 \r
16 /*\r
17  * Use this listener to ensure caching for a request. This listener will not lock the request in cache.\r
18  * \r
19  */\r
20 public class TransientCacheListener<T> implements Listener<T> {\r
21 \r
22     @SuppressWarnings("rawtypes")\r
23     private static TransientCacheListener INSTANCE = new TransientCacheListener();\r
24 \r
25     @SuppressWarnings("unchecked")\r
26     public static <T> TransientCacheListener<T> instance() {\r
27         return (TransientCacheListener<T>) INSTANCE;\r
28     }\r
29 \r
30     @Override\r
31     public final boolean isDisposed() {\r
32         return true;\r
33     }\r
34 \r
35     @Override\r
36     public int hashCode() {\r
37         return TransientCacheListener.class.hashCode();\r
38     }\r
39 \r
40     @Override\r
41     public boolean equals(Object other) {\r
42         return other instanceof TransientCacheListener<?>;\r
43     }\r
44 \r
45     @Override\r
46     public void execute(T result) {\r
47     }\r
48 \r
49     @Override\r
50     public void exception(Throwable t) {\r
51     }\r
52 \r
53 }