]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.indexing/src/org/simantics/db/indexing/IndexedRelationsInitializer.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.indexing / src / org / simantics / db / indexing / IndexedRelationsInitializer.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.indexing;\r
13 \r
14 import org.eclipse.core.runtime.IStatus;\r
15 import org.eclipse.core.runtime.Status;\r
16 import org.simantics.db.Session;\r
17 import org.simantics.db.layer0.genericrelation.IndexedRelations;\r
18 import org.simantics.db.services.ServiceInitializer;\r
19 \r
20 public class IndexedRelationsInitializer implements ServiceInitializer {\r
21 \r
22     @Override\r
23     public IStatus initialize(Session s) {\r
24         IndexedRelations srv = s.peekService(IndexedRelations.class);\r
25         if (srv == null || srv.getClass() != IndexedRelations.class)\r
26             s.registerService(IndexedRelations.class, new IndexedRelationsImpl());\r
27 \r
28         return Status.OK_STATUS;\r
29     }\r
30 \r
31 }\r