Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Refactored code.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.wso2.org/repos/wso2/trunk/wsf@67626 a5903396-d722-0410-b921-86c7d4935375
  • Loading branch information
heshan committed Jun 5, 2010
1 parent 4800870 commit 53eb545
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
import org.wso2.wsf.jython.messagereceiver.PythonScriptReceiver;
import org.wso2.wsf.jython.deployer.schemagenarator.*;

/**
* Python service deployer.
*/
public class PythonDeployer implements Deployer {
private static final Log log = LogFactory.getLog(PythonDeployer.class);

Expand Down Expand Up @@ -118,7 +121,7 @@ public void deploy(DeploymentFileData deploymentFileData) {
}

public ArrayList<AxisService> processService(DeploymentFileData currentFile,
AxisServiceGroup axisServiceGroup, String repoPath)
AxisServiceGroup axisServiceGroup, String repoPath)
throws AxisFault {
try {
String serviceName = DescriptionBuilder.getShortFileName(currentFile.getName());
Expand All @@ -128,7 +131,7 @@ public ArrayList<AxisService> processService(DeploymentFileData currentFile,
if (log.isDebugEnabled()) {
System.out.println(" Script Repo Path : " + repoPath);
log.debug(serviceName + " python script is being processed !");
log.debug("serviceName :" + serviceName);
log.debug("serviceName :" + serviceName);
log.debug("currentFileName AbsolutePath :" + currentFile.getAbsolutePath());
log.debug("currnetFileName :" + currentFile.getName());
}
Expand Down Expand Up @@ -196,9 +199,9 @@ public ArrayList<AxisService> processService(DeploymentFileData currentFile,
* Reads the annotations in the python script and maps the annotations to schema. Generates the xml schema for the
* python service
*
* @param map - The HashMap which contains the annotations of the python service
* @param axisService - The axis service
* @param schemaGenerator - The schema generator
* @param map The HashMap which contains the annotations of the python service
* @param axisService The axis service
* @param schemaGenerator The schema generator
*/
private void annotationsToSchema(HashMap map, AxisService axisService, SchemaGenerator schemaGenerator) {
//HashMap map = (HashMap) obj2.__tojava__(HashMap.class);
Expand Down Expand Up @@ -310,7 +313,7 @@ private void annotationsToSchema(HashMap map, AxisService axisService, SchemaGen
inSchemaElement = schemaGenerator.createInputElement(inComplexType, opName);
outSchemaElement = schemaGenerator.createOutputElement(outComplexType, opName);
} catch (Exception e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
e.printStackTrace();
}
QName inParamElementQname = inSchemaElement.getQName(); // set this to the QName of the in message
QName outParamElementQname = outSchemaElement.getQName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

public class ComplexType extends Type{

private ArrayList members = new ArrayList();
private ArrayList<Type> members = new ArrayList<Type>();

public ArrayList getMembers() {
public ArrayList<Type> getMembers() {
return members;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import javax.xml.namespace.QName;
import java.util.Iterator;

/**
* Schema generation class.
*/
public class SchemaGenerator {

private String schemaTargetNamespace;
Expand Down Expand Up @@ -126,7 +129,7 @@ private XmlSchemaComplexType createComplexType(ComplexType complexType, String e
xmlSchema.getItems().add(xmlSchemaComplexType);

XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence();
Iterator iterator = complexType.getMembers().iterator();
Iterator<Type> iterator = complexType.getMembers().iterator();
while (iterator.hasNext()) {
Object object = iterator.next();
XmlSchemaElement xmlSchemaElement;
Expand Down Expand Up @@ -183,9 +186,8 @@ private XmlSchemaSimpleType handleEnumeration(String name, String[] enums) {
simpleType.setContent(simpleTypeRestriction);

// Create enumeration facets for each value
for (int i = 0; i < enums.length; i++) {

String enumeration = enums[i].trim();
for (String anEnum : enums) {
String enumeration = anEnum.trim();
XmlSchemaEnumerationFacet enumerationFacet = new XmlSchemaEnumerationFacet();
enumerationFacet.setValue(enumeration);
simpleTypeRestriction.getFacets().add(enumerationFacet);
Expand Down

0 comments on commit 53eb545

Please sign in to comment.