ozone core API

org.ozoneDB.tools
Class OIG

java.lang.Object
  extended byorg.ozoneDB.tools.OIG

public class OIG
extends java.lang.Object

Ozone Interface Generator

This class is meant to be run statically only. It will generate an OzoneRemote interface for your OzoneObject (s)

USAGE:

 java OzoneInterfaceGenerator your_OzoneObject

CONVENTIONS:

 Class Names

 OzoneObject classes must be named like *Impl.java. Interfaces are generated with a _Int inserted into the name.

File Naming:

OzoneObjects must have names like: CarImpl.java The interface generated will be: CarImpl_Int.java

You do not have to use "Impl". Any name will do. I use a standard because it is then easy to write makefile rules like:

%.class: %.java
    javac $(JFLAGS) -classpath $(CPATH) $<

%Impl_Proxy.class: %Impl.java
   /projects/ozone/bin/opp $*Impl

%Impl_Int.java: %Impl.java
   java -Djava.compiler=tya -classpath $(CPATH) OzoneInterfaceGenerator $*Impl

javasrc = $(wildcard *.java)
classes = $(javasrc:.java=.class)
htmlobjs = $(javasrc:.java=.html)
IntSrc = $(wildcard *Impl.java)
IntObjs = $(IntSrc:Impl.java=Impl_Int.java)
proxies = $(IntSrc:Impl.java=Impl_Proxy.class)
proxysrc = $(IntSrc:Impl.java=Impl.class)

Coding Style

 Public methods must have ALL parameters on one line. Infact everything up to and including the open curly brace must be on the first line.

Patterns for identifying methods which should be locked are stored in a file called int_config. This file should be in the same directory as the .java files. You need to list one pattern per line. Like:
 set
 update
 reset
 delete
 modify
 
 

OzoneInterfaceGenerator looks for and reads these in. If the first line of your public method contains any of these strings it appends //update to the end signaling OPP to make that method a locked() method.

If you do not provide a int_config file OIG uses my favorites, listed above.

Public Method Examples:

public void setName(String _name) { this.name = _name; }
 in the generated interface it produces:
 public void setName(String _name);//update
 
 

In the following example I use a comment to identify the update method. One of the patterns just has to be on the first line.
 
 
public void killMe() { // update
 Produces:
 public void killMe();//update
 
 

NOTE:

 OIG will handle this:

 public static final String x = new String("test");
 
 

BUT not this: (working on this :) It will get mistaken for a method.

 public String x = new String("test");
 
 


Constructor Summary
OIG()
           
 
Method Summary
private static java.util.Vector getPatterns()
           
static void main(java.lang.String[] args)
           
private static java.lang.String remove(java.lang.String buf, java.lang.String rem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OIG

public OIG()
Method Detail

main

public static void main(java.lang.String[] args)

getPatterns

private static java.util.Vector getPatterns()

remove

private static java.lang.String remove(java.lang.String buf,
                                       java.lang.String rem)

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.