JavaAtomicGroundingImpl.java revision 2
/*
* Created on 13.04.2005
*/
/**
* A JavaAtomicGrounding grounds an OWL-S Service to a Java method invocation. The method call
* is specified by its method signature in an OWL-S Ontology. The driving parts are:
* <ul>
* <li>fully qualified class name</li>
* <li>method name</li>
* <li>a map of all input parameters (at the time only primitive datatypes and their adapter classes)</li>
* <li>an output type (at the time only primitive datatypes and their adapter classes)</li>
* </ul>
*
* @author Michael Daenzer, University of Z�rich
*
* @see <a href="http://www.ifi.unizh.ch/ddis/ont/owl_s/MoreGroundings.owl">Grounding Ontology</a>
* @see org.mindswap.owls.grounding.AtomicGrounding
* @see org.mindswap.owls.vocabulary.NextOnt
* @see impl.owls.grounding.AtomicGroundingImpl
*/
/**
* @param ind
*/
super(ind);
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.JavaAtomicGrounding#setClaz(java.lang.String)
*/
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.JavaAtomicGrounding#getClaz()
*/
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.JavaAtomicGrounding#setMethod(java.lang.String)
*/
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.JavaAtomicGrounding#getMethod()
*/
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.AtomicGrounding#getDescriptionURL()
*/
public URL getDescriptionURL() {
return null;
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.AtomicGrounding#addMessageMap(org.mindswap.owls.process.Parameter, java.lang.String, java.lang.String)
*/
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.AtomicGrounding#getInputMap()
*/
public MessageMapList getInputMap() {
return null;
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.AtomicGrounding#getOutputMap()
*/
public MessageMapList getOutputMap() {
return null;
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.AtomicGrounding#invoke(org.mindswap.query.ValueMap)
*/
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.AtomicGrounding#invoke(org.mindswap.query.ValueMap, org.mindswap.owl.OWLKnowledgeBase)
*/
// get and check class
throw new ExecutionException("JavaAtomicGrounding: No Java Class defined in Grounding!");
// get and check method
throw new ExecutionException("JavaAtomicGrounding: No Java Method defined in Grounding!");
// TODO dmi get types from owl paramtype
// prepare parameters
for (int i = 0; i < getInputOWLSParamsSize(); i++) {
params[i] = getInputJavaParamAt(i);
}
// get class and method reference
try {
} catch (ClassNotFoundException e){
throw new ExecutionException("JavaAtomicGrounding: Class " + strClaz + " defined in Grounding not found." );
} catch (NoSuchMethodException e) {
throw new ExecutionException("JavaAtomicGrounding: Method " + strMethod + " defined in Grounding not found." );
} catch (Exception e) {
throw new ExecutionException("JavaAtomicGrounding: " + e.getClass().toString() + " ocurred: " + e.getMessage());
}
// prepare inputs
if (owlValue.isDataValue())
paramValues[i] = ReflectionHelpers.getCastedObjectFromStringValue(((OWLDataValue) owlValue).getLexicalValue(), params[i]);
else {
}
else
}
}
// invoke java method
try {
else
} catch (InvocationTargetException e) {
throw new ExecutionException("JavaAtomicGrounding: Error in executed method\n" + e.getTargetException().toString() + " ocurred: ");
} catch (Exception e) {
throw new ExecutionException("JavaAtomicGrounding: Error while executing method\n" + e.getClass().toString() + " ocurred: ");
}
// set output
throw new ExecutionException("JavaAtomicGrounding: Output in Grounding not specified although method provides a return value.");
else
}
return results;
}
// returns the OWL-S Output Parameter
private Parameter getOutputOWLSParam() {
OWLObject owlsParam = getProperty(MoreGroundings.javaOutput).getProperty(MoreGroundings.owlsParameter);
}
// Implements the Singleton Pattern for the private field inParamList
private void createInputOWLSParamList() {
if (inParamList == null)
}
// returns the n-th OWL-S Input Parameter
// TODO dmi throw exception
if (index >= getInputOWLSParamsSize())
return null;
for (int i = 0; i < getInputOWLSParamsSize(); i++) {
}
}
return null;
}
// returns the n-th XSLT transformtion
// TODO dmi throw exception
if (index >= getInputOWLSParamsSize())
return null;
for (int i = 0; i < getInputOWLSParamsSize(); i++) {
OWLDataValue xslt = inParamList.individualAt(i).getProperty(OWLS.Grounding.xsltTransformationString);
}
}
return null;
}
// returns the n-th Parameter of the Java Method specified in the OWL-S JavaAtomicProcessGrounding
// TODO dmi throw exception
if (index >= getInputOWLSParamsSize())
return null;
for (int i = 0; i < getInputOWLSParamsSize(); i++) {
String javaType = inParamList.individualAt(i).getProperty(MoreGroundings.javaType).getValue().toString();
}
}
return null;
}
// returns the number of OWL-S Input Parameters
private int getInputOWLSParamsSize() {
return inParamList.size();
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.JavaAtomicGrounding#setOutputVar(java.lang.String, java.lang.String, org.mindswap.owls.process.Output)
*/
}
/* (non-Javadoc)
* @see org.mindswap.owls.grounding.JavaAtomicGrounding#setInputVar(java.lang.String, java.lang.String, int, org.mindswap.owls.process.Input)
*/
}
}