KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > AbstractDatabase


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: AbstractDatabase.java,v 1.5 2003/11/07 21:34:21 per_nyfelt Exp $
8

9 package org.ozoneDB;
10
11 import org.ozoneDB.tools.OPP.OPP;
12
13 /**
14     Implementation of methods common to subclasses.
15     @author <a HREF="http://www.medium.net/">Medium.net</a>
16 */

17 abstract class AbstractDatabase extends Object JavaDoc implements OzoneInterface {
18
19     public final static int DefaultAccessRight = Public;
20
21     public OzoneProxy createObject( String JavaDoc className ) throws RuntimeException JavaDoc, OzoneRemoteException {
22         return createObject( className, DefaultAccessRight, null, null, null );
23     }
24
25     public OzoneProxy createObject( String JavaDoc className, int access ) throws RuntimeException JavaDoc, OzoneRemoteException {
26         return createObject( className, access, null, null, null );
27     }
28
29     public OzoneProxy createObject( String JavaDoc className, int access, String JavaDoc objName ) throws RuntimeException JavaDoc, OzoneRemoteException {
30         return createObject( className, access, objName, null, null );
31     }
32
33     public OzoneProxy createObject( String JavaDoc className, String JavaDoc sig, Object JavaDoc[] args ) throws RuntimeException JavaDoc, OzoneRemoteException {
34         return createObject(className,DefaultAccessRight,null,sig,args);
35     }
36
37     public OzoneProxy createObject(Class JavaDoc type) throws RuntimeException JavaDoc, OzoneRemoteException {
38         return createObject(type.getName());
39     }
40
41     public OzoneProxy createObject(Class JavaDoc type, int access ) throws RuntimeException JavaDoc, OzoneRemoteException {
42         return createObject(type.getName(), access);
43     }
44
45     public OzoneProxy createObject(Class JavaDoc type, int access, String JavaDoc objName ) throws RuntimeException JavaDoc, OzoneRemoteException {
46         return createObject(type.getName(), access, objName);
47     }
48
49     public OzoneProxy createObject(Class JavaDoc type, int access, String JavaDoc objName, Class JavaDoc[] sig, Object JavaDoc[] args) throws RuntimeException JavaDoc, OzoneRemoteException {
50         return createObject(type.getName(),access,objName, createSignature(sig),args);
51     }
52
53     public OzoneProxy createObject(Class JavaDoc type, Class JavaDoc[] sig, Object JavaDoc[] args ) throws RuntimeException JavaDoc, OzoneRemoteException {
54         return createObject(type.getName(), createSignature(sig),args);
55     }
56
57     protected String JavaDoc createSignature(Class JavaDoc[] sig) {
58         if (sig == null || sig.length == 0) {
59             return null;
60         }
61         String JavaDoc signature = sig[0].getName();
62         for (int i = 1; i < sig.length; i++) {
63             signature = signature + OPP.SIGNATURE_DELIMITER + sig[i].getName();
64         }
65         return signature;
66     }
67 }
Popular Tags