KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > joseki > server > source > SourceControllerPermanent


1 /*
2  * (c) Copyright 2004 Hewlett-Packard Development Company, LP
3  * [See end of file]
4  */

5
6 package org.joseki.server.source;
7
8 //import org.joseki.vocabulary.JosekiVocab ;
9

10 import com.hp.hpl.jena.rdf.model.* ;
11
12 import org.joseki.server.*;
13 //import org.joseki.server.module.Loadable;
14
import org.apache.commons.logging.* ;
15
16 /** A SourceController for permanent models (i.e. sources that are
17  * loaded once and kept in memory).
18  *
19  * @author Andy Seaborne
20  * @version $Id: SourceControllerPermanent.java,v 1.1 2004/04/29 17:58:32 andy_seaborne Exp $
21  */

22
23 public class SourceControllerPermanent implements SourceController //, Loadable
24
{
25     static Log logger = LogFactory.getLog(SourceControllerPermanent.class.getName()) ;
26     
27     String JavaDoc serverURI ;
28     Model model ;
29
30     // ----------------------------------------------------------
31
// -- Own operations :
32

33     public SourceControllerPermanent(Model _model)
34     {
35         model = _model ;
36     }
37     
38     // ----------------------------------------------------------
39
// -- Loadable interface : this controller isn't a loadable thingy
40

41     //public String getInterfaceURI() { return JosekiVocab.SourceController.getURI() ; }
42
//public void init(Resource binding, Resource implementation) { return ; }
43

44     // ----------------------------------------------------------
45
// -- SourceController interface
46

47     // Called once, during configuration
48
public ModelSource createSourceModel(Resource description, String JavaDoc _serverURI)
49     {
50         serverURI = _serverURI ;
51         return new ModelSourcePermanent(this, model, serverURI) ;
52     }
53     
54     public String JavaDoc getServerURI() { return serverURI ; }
55     
56     // Called when used.
57
public void activate() { logger.trace("activate") ; return ; }
58     
59     // Called when not in use any more.
60
public void deactivate() { logger.trace("deactivate") ; return ; }
61
62     // Called each time a source needs to be built.
63
public Model buildSource()
64     {
65         logger.debug("buildSource: "+serverURI) ;
66         return null ;
67     }
68     
69     // Called when released (if releasable)
70
public void releaseSource()
71     {
72         logger.debug("releaseSource: "+serverURI) ;
73     }
74 }
75
76 /*
77  * (c) Copyright 2004 Hewlett-Packard Development Company, LP
78  * All rights reserved.
79  *
80  * Redistribution and use in source and binary forms, with or without
81  * modification, are permitted provided that the following conditions
82  * are met:
83  * 1. Redistributions of source code must retain the above copyright
84  * notice, this list of conditions and the following disclaimer.
85  * 2. Redistributions in binary form must reproduce the above copyright
86  * notice, this list of conditions and the following disclaimer in the
87  * documentation and/or other materials provided with the distribution.
88  * 3. The name of the author may not be used to endorse or promote products
89  * derived from this software without specific prior written permission.
90  *
91  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
92  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
93  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
94  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
95  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
96  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
97  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
98  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
99  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
100  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
101  */

102
Popular Tags