SandMark version 2.0


sandmark.watermark.ct.embed
Class Embedder

java.lang.Object
  |
  +--sandmark.watermark.ct.embed.Embedder

public class Embedder
extends java.lang.Object

The sandmark.watermark.ct.embed.Embedder class contains methods for adding watermarking code to Java bytecode.


Field Summary
(package private)  CallForest callForest
           
(package private)  ClassFileCollection cfc
           
(package private)  Encoder encoder
           
(package private)  java.util.Properties props
           
(package private)  Stats statistics
           
(package private)  TracePoint[] traceData
           
 
Constructor Summary
Embedder(java.util.Properties props, TracePoint[] traceData)
           
 
Method Summary
(package private)  MethodID[] allMethods()
           
(package private)  Graph constructGraph(java.util.Properties props)
          Construct and return a graph embedding the value WM_Encode_Watermark using encoding DWM_CT_Encode_Encoding.
(package private)  void embedClass(ClassFileCollection cfc, de.fub.bytecode.classfile.JavaClass watermarkClass, EmbedData[] embedData, MethodID[] methods, java.util.Properties props)
          Add the watermark class to the cfc, and embed calls to it based on the embedding information in 'embedData'.
(package private)  EmbedData[] findEmbedding(de.fub.bytecode.classfile.JavaClass classFile, TracePoint[] traceData)
          Decide where the methods in the watermark class should be called in the application.
 EmbedData[] getEmbedding()
           
 void saveByteCode()
           
 void saveSource(java.lang.String sourceFileName)
           
 java.lang.String source()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

props

java.util.Properties props

traceData

TracePoint[] traceData

cfc

ClassFileCollection cfc

encoder

Encoder encoder

callForest

CallForest callForest

statistics

Stats statistics
Constructor Detail

Embedder

public Embedder(java.util.Properties props,
                TracePoint[] traceData)
         throws java.lang.Exception
Parameters:
props - global property list
traceData - a vector of annotation points that were hit during tracing

Reads properties:

Method Detail

allMethods

MethodID[] allMethods()
                throws java.io.IOException
java.io.IOException

saveByteCode

public void saveByteCode()
                  throws java.lang.Exception
java.lang.Exception

getEmbedding

public EmbedData[] getEmbedding()
                         throws java.lang.Exception
java.lang.Exception

source

public java.lang.String source()

saveSource

public void saveSource(java.lang.String sourceFileName)
                throws java.lang.Exception
java.lang.Exception

findEmbedding

EmbedData[] findEmbedding(de.fub.bytecode.classfile.JavaClass classFile,
                          TracePoint[] traceData)
                    throws java.lang.Exception
Decide where the methods in the watermark class should be called in the application.

Parameters:
classFile - The class that builds the watermark graph.
traceData - Location of trace points hit during the tracing run.
java.lang.Exception

embedClass

void embedClass(ClassFileCollection cfc,
                de.fub.bytecode.classfile.JavaClass watermarkClass,
                EmbedData[] embedData,
                MethodID[] methods,
                java.util.Properties props)
          throws java.lang.Exception
Add the watermark class to the cfc, and embed calls to it based on the embedding information in 'embedData'.

Parameters:
cfc - The application to be watermarked.
watermarkClass - The class that builds the watermark graph.
embedData - Where in the cfc calls to watermarkClass should be embedded.
methods - The methods to which formal parameters should be added to pass around storage containers.
java.lang.Exception

constructGraph

Graph constructGraph(java.util.Properties props)
               throws java.lang.Exception
Construct and return a graph embedding the value WM_Encode_Watermark using encoding DWM_CT_Encode_Encoding.

Parameters:
props - The property collection.

props contains at least:

java.lang.Exception

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002