/** * @param name */ public OperationImpl() { inputType = new DataTypeImpl<List<DataType>>(IDL_INPUT, Object[].class, new ArrayList<DataType>()); outputType = new DataTypeImpl<List<DataType>>(IDL_OUTPUT, Object[].class, new ArrayList<DataType>()); faultTypes = new ArrayList<DataType>(); faultBeans = new HashMap<QName, List<DataType<XMLType>>>(); }
} else { if (isAsyncMethod) { returnDataType = new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, returnType, returnType, xmlReturnType); } else { returnDataType = new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, returnType, method.getGenericReturnType(), xmlReturnType); XMLType xmlParamType = new XMLType(new QName(ns, "arg" + i), null); DataTypeImpl<XMLType> xmlDataType = new DataTypeImpl<XMLType>( UNKNOWN_DATABINDING, paramType, genericParamTypes[i],xmlParamType); ParameterMode mode = ParameterMode.IN; Type firstActual = getFirstActualType( genericParamTypes[ i ] ); if ( firstActual != null ) { xmlDataType.setPhysical( (Class<?>)firstActual ); mode = ParameterMode.INOUT; XMLType xmlFaultType = new XMLType(new QName(ns, faultType.getSimpleName()), null); DataType<XMLType> faultDataType = new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, faultType, genericFaultTypes[i], xmlFaultType); faultDataTypes.add(new DataTypeImpl<DataType>(UNKNOWN_DATABINDING, faultType, genericFaultTypes[i], faultDataType)); new DataTypeImpl<List<DataType>>(IDL_INPUT, Object[].class, paramDataTypes); DataType<List<DataType>> outputType = new DataTypeImpl<List<DataType>>(IDL_OUTPUT, Object[].class, outputDataTypes);
} else { if (isAsyncMethod) { returnDataType = new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, returnType, returnType, xmlReturnType); } else { returnDataType = new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, returnType, method.getGenericReturnType(), xmlReturnType); XMLType xmlParamType = new XMLType(new QName(ns, "arg" + i), null); DataTypeImpl<XMLType> xmlDataType = new DataTypeImpl<XMLType>( UNKNOWN_DATABINDING, paramType, genericParamTypes[i],xmlParamType); ParameterMode mode = ParameterMode.IN; Type firstActual = getFirstActualType( genericParamTypes[ i ] ); if ( firstActual != null ) { xmlDataType.setPhysical( (Class<?>)firstActual ); mode = ParameterMode.INOUT; XMLType xmlFaultType = new XMLType(new QName(ns, faultType.getSimpleName()), null); DataType<XMLType> faultDataType = new DataTypeImpl<XMLType>(UNKNOWN_DATABINDING, faultType, genericFaultTypes[i], xmlFaultType); faultDataTypes.add(new DataTypeImpl<DataType>(UNKNOWN_DATABINDING, faultType, genericFaultTypes[i], faultDataType)); new DataTypeImpl<List<DataType>>(IDL_INPUT, Object[].class, paramDataTypes); DataType<List<DataType>> outputType = new DataTypeImpl<List<DataType>>(IDL_OUTPUT, Object[].class, outputDataTypes);
/** * @param name */ public OperationImpl() { inputType = new DataTypeImpl<List<DataType>>(IDL_INPUT, Object[].class, new ArrayList<DataType>()); outputType = new DataTypeImpl<List<DataType>>(IDL_OUTPUT, Object[].class, new ArrayList<DataType>()); faultTypes = new ArrayList<DataType>(); faultBeans = new HashMap<QName, List<DataType<XMLType>>>(); }
public DOMElementXmlAdapter(Mediator mediator, DataType dataType) { this.mediator = mediator; this.dataType = dataType; this.domType = new DataTypeImpl(DOMDataBinding.NAME, Element.class, dataType.getLogical()); }
public DataType introspect(Object value, Operation operation) { if (value == null) { return null; } else { DataType<Class> dataType = new DataTypeImpl<Class>(value.getClass(), value.getClass()); if (introspect(dataType, (Operation) null)) { return dataType; } else { return null; } } }
public DataType introspect(Object value, Operation operation) { if (value == null) { return null; } else { DataType<Class> dataType = new DataTypeImpl<Class>(value.getClass(), value.getClass()); if (introspect(dataType, (Operation) null)) { return dataType; } else { return null; } } }
public DOMElementXmlAdapter(Mediator mediator, DataType dataType) { this.mediator = mediator; this.dataType = dataType; this.domType = new DataTypeImpl(DOMDataBinding.NAME, Element.class, dataType.getLogical()); }
protected DataType createDataType(Class<?> type, Type genericType) { DataType dataType = new DataTypeImpl(null, type, genericType, genericType); dataBindingExtensionPoint.introspectType(dataType, null); return dataType; }
private DataType getDataType(ElementInfo element) { DataType type = null; if (element.isMany()) { DataType logical = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element)); type = new DataTypeImpl<DataType>("java:array", Object[].class, logical); } else { type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element)); } return type; }
private DataType getDataType(ElementInfo element) { DataType type = null; if (element.isMany()) { DataType logical = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element)); type = new DataTypeImpl<DataType>("java:array", Object[].class, logical); } else { type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element)); } return type; }
/** * Creates and caches the data types for the child elements * * @return The list of child element data types */ public DataType<List<DataType>> getUnwrappedType() { if (unwrappedType == null) { List<DataType> childTypes = new ArrayList<DataType>(); for (ElementInfo element : getChildElements()) { DataType type = getDataType(element); childTypes.add(type); } unwrappedType = new DataTypeImpl<List<DataType>>("idl:unwrapped", Object[].class, childTypes); } return unwrappedType; }
/** * Creates and caches the data types for the child elements * * @return The list of child element data types */ public DataType<List<DataType>> getUnwrappedType() { if (unwrappedType == null) { List<DataType> childTypes = new ArrayList<DataType>(); for (ElementInfo element : getChildElements()) { DataType type = getDataType(element); childTypes.add(type); } unwrappedType = new DataTypeImpl<List<DataType>>("idl:unwrapped", Object[].class, childTypes); } return unwrappedType; }
private DataType<List<DataType>> getMessageType(Message message) throws InvalidWSDLException { List<DataType> partTypes = new ArrayList<DataType>(); if (message != null) { Collection parts = message.getOrderedParts(null); for (Object p : parts) { WSDLPart part = new WSDLPart((Part)p, Object.class); DataType<XMLType> partType = part.getDataType(); partTypes.add(partType); } } return new DataTypeImpl<List<DataType>>(dataBinding, Object[].class, partTypes); }
private DataType<List<DataType>> getMessageType(Message message) throws InvalidWSDLException { List<DataType> partTypes = new ArrayList<DataType>(); if (message != null) { Collection parts = message.getOrderedParts(null); for (Object p : parts) { WSDLPart part = new WSDLPart((Part)p, Object.class); DataType<XMLType> partType = part.getDataType(); partTypes.add(partType); } } return new DataTypeImpl<List<DataType>>(dataBinding, Object[].class, partTypes); }
/** * @param source The source exception * @param sourceExType The data type for the source exception * @param targetExType The data type for the target exception * @param sourceType The fault type for the source * @param targetType The fault type for the target * @return */ private Object transformException(Object source, DataType sourceExType, DataType targetExType, DataType sourceType, DataType targetType, Map<String, Object> metadata) { if (sourceType == targetType || (sourceType != null && sourceType.equals(targetType))) { return source; } DataType<DataType> eSourceDataType = new DataTypeImpl<DataType>(IDL_FAULT, sourceExType.getPhysical(), sourceType); DataType<DataType> eTargetDataType = new DataTypeImpl<DataType>(IDL_FAULT, targetExType.getPhysical(), targetType); return mediate(source, eSourceDataType, eTargetDataType, metadata); }
/** * Produce the equivalent sync method input parameters from the input parameters of the async method * @param requestParams - async method input parameters * @return - the equivalent sync method input parameters */ private DataType<List<DataType>> prepareSyncInputParams( DataType<List<DataType>> requestParams ) { List<DataType> requestLogical = requestParams.getLogical(); int paramCount = requestLogical.size(); // Copy the list of async parameters, removing the final DispatchResponse List<DataType> asyncParams = new ArrayList<DataType>( paramCount - 1); for( int i = 0 ; i < (paramCount - 1) ; i++ ) { asyncParams.add( requestLogical.get(i) ); } // end for DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(requestParams.getDataBinding(), requestParams.getPhysical(), asyncParams); return inputType; } // end method prepareSyncInputParams
/** * Produce the equivalent sync method input parameters from the input parameters of the async method * @param requestParams - async method input parameters * @return - the equivalent sync method input parameters */ private DataType<List<DataType>> prepareSyncInputParams( DataType<List<DataType>> requestParams ) { List<DataType> requestLogical = requestParams.getLogical(); int paramCount = requestLogical.size(); // Copy the list of async parameters, removing the final DispatchResponse List<DataType> asyncParams = new ArrayList<DataType>( paramCount - 1); for( int i = 0 ; i < (paramCount - 1) ; i++ ) { asyncParams.add( requestLogical.get(i) ); } // end for DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(requestParams.getDataBinding(), requestParams.getPhysical(), asyncParams); return inputType; } // end method prepareSyncInputParams
/** * @param source The source exception * @param sourceExType The data type for the source exception * @param targetExType The data type for the target exception * @param sourceType The fault type for the source * @param targetType The fault type for the target * @return */ private Object transformException(Object source, DataType sourceExType, DataType targetExType, DataType sourceType, DataType targetType, Map<String, Object> metadata) { if (sourceType == targetType || (sourceType != null && sourceType.equals(targetType))) { return source; } DataType<DataType> eSourceDataType = new DataTypeImpl<DataType>(IDL_FAULT, sourceExType.getPhysical(), sourceType); DataType<DataType> eTargetDataType = new DataTypeImpl<DataType>(IDL_FAULT, targetExType.getPhysical(), targetType); return mediate(source, eSourceDataType, eTargetDataType, metadata); }
private TransformationContext createTransformationContext(DataType sourceDataType, DataType targetDataType, int size, int index, Transformer transformer, Map<String, Object> metadata) { DataType sourceType = (index == 0) ? sourceDataType : new DataTypeImpl<Object>(transformer.getSourceDataBinding(), Object.class, sourceDataType.getLogical()); DataType targetType = (index == size - 1) ? targetDataType : new DataTypeImpl<Object>(transformer.getTargetDataBinding(), Object.class, targetDataType.getLogical()); Map<String, Object> copy = new HashMap<String, Object>(); if (metadata != null) { copy.putAll(metadata); } copy.put(ExtensionPointRegistry.class.getName(), registry); TransformationContext context = new TransformationContextImpl(sourceType, targetType, copy); return context; }