work.addProperty( HttpUrlContinuationWorkSource.PROPERTY_URI_PATH, uriPath); if (isSecure != null) { work.addProperty( HttpUrlContinuationWorkSource.PROPERTY_SECURE, String.valueOf(isSecure)); SectionTask task = work.addSectionTask(taskName, HttpUrlContinuationWorkSource.TASK_NAME);
@Override public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws Exception { final Map<Class<?>, SectionObject> objects = new HashMap<Class<?>, SectionObject>(); final Map<Class<?>, SectionOutput> escalations = new HashMap<Class<?>, SectionOutput>(); // Add file sender SectionWork sendFileWork = designer.addSectionWork("FILE", HttpFileSenderWorkSource.class.getName()); SourceHttpResourceFactory.copyProperties(context, sendFileWork); SectionTask sendFileTask = sendFileWork.addSectionTask( HttpFileSenderWorkSource.TASK_NAME, HttpFileSenderWorkSource.TASK_NAME); WebApplicationSectionSource.linkObject(sendFileTask, DependencyKeys.SERVER_HTTP_CONNECTION.name(), ServerHttpConnection.class, designer, objects); WebApplicationSectionSource.linkObject(sendFileTask, DependencyKeys.HTTP_APPLICATION_LOCATION.name(), HttpApplicationLocation.class, designer, objects); WebApplicationSectionSource.linkEscalation(sendFileTask, IOException.class, designer, escalations); WebApplicationSectionSource.linkEscalation(sendFileTask, InvalidHttpRequestUriException.class, designer, escalations); // Provide input to service SectionInput input = designer.addSectionInput(SERVICE_INPUT_NAME, null); designer.link(input, sendFileTask); // Provide output once file written SectionOutput output = designer.addSectionOutput(FILE_SENT_OUTPUT_NAME, null, false); designer.link(sendFileTask, output); }
SectionTask routeTask = routeWork.addSectionTask("ROUTE", HttpRouteWorkSource.TASK_NAME); linkObject(routeTask, SectionTask sendResponseTask = sendResponseWork.addSectionTask("SEND", "SEND"); linkObject(sendResponseTask,
/** * Adds handling for a {@link Servlet} resource. * * @param inputName * {@link SectionInput} name. * @param requestDispatcherPath * {@link RequestDispatcher} path. * @param servletBridge * {@link ServletBridge} {@link SectionObject}. * @param designer * {@link SectionDesigner}. */ private void addServletResource(String inputName, String requestDispatcherPath, SectionObject servletBridge, SectionDesigner designer) { // Create the task to indicate Servlet container resource SectionWork work = designer.addSectionWork(inputName, ServletContainerResourceWorkSource.class.getName()); work.addProperty( ServletContainerResourceWorkSource.PROPERTY_SERVLET_CONTAINER_RESOURCE, requestDispatcherPath); SectionTask task = work.addSectionTask(inputName, "RESOURCE"); TaskObject dependency = task .getTaskObject(DependencyKeys.SERVLET_BRIDGE.name()); designer.link(dependency, servletBridge); // Link input for task SectionInput input = designer.addSectionInput(inputName, null); designer.link(input, task); }
HttpFileWorkSource.class.getName()); SourceHttpResourceFactory.copyProperties(context, work); work.addProperty(HttpFileWorkSource.PROPERTY_RESOURCE_PATH, resourcePath); SectionTask task = work.addSectionTask(resourcePath, HttpFileWorkSource.TASK_HTTP_FILE);
subscribeWork.addProperty(ClassWorkSource.CLASS_NAME_PROPERTY_NAME, SubscribeWork.class.getName()); SectionTask preSubscription = subscribeWork.addSectionTask( "PRE_SUBSCRIBE", "preSubscribe"); designer.link(preSubscription.getTaskObject(CometRequestServicer.class SectionTask postSubscription = subscribeWork.addSectionTask( "POST_SUBSCRIBE", "postSubscribe"); designer.link(postSubscription.getTaskObject(CometRequestServicer.class SectionTask publishTask = publishWork.addSectionTask("PUBLISH", PublishWorkSource.TASK_NAME); designer.link(publishTask publishWork.addProperty( PublishWorkSource.PROPERTY_MANUAL_PUBLISH_URI_PREFIX + outputFlowName, requestUriPrefix);
GwtServiceWorkSource.class.getName()); for (Property property : properties) { work.addProperty(property.getName(), property.getValue()); SectionTask task = work.addSectionTask( gwtServiceName, GwtServiceWorkSource.SERVICE_TASK_NAME);
HttpTemplateInitialWorkSource.PROPERTY_RENDER_REDIRECT_HTTP_METHODS, HttpTemplateInitialWorkSource.PROPERTY_CONTENT_TYPE, HttpTemplateInitialWorkSource.PROPERTY_CHARSET); SectionTask initialTask = initialWork.addSectionTask("_INITIAL_TASK_", HttpTemplateInitialWorkSource.TASK_NAME); designer.link(initialTask.getTaskObject("SERVER_HTTP_CONNECTION"), connectionObject); designer.link(initialTask.getTaskObject("HTTP_APPLICATION_LOCATION"), locationObject); templateWork.addProperty(HttpTemplateWorkSource.PROPERTY_TEMPLATE_CONTENT, templateContent); SectionTask templateTask = templateWork.addSectionTask(templateTaskName, templateTaskName); templateWork.addProperty(HttpTemplateWorkSource.PROPERTY_BEAN_PREFIX + templateTaskName, beanType.getName()); arrayIteratorWork.addProperty(HttpTemplateArrayIteratorWorkSource.PROPERTY_COMPONENT_TYPE_NAME, beanType.getName()); SectionTask arrayIteratorTask = arrayIteratorWork.addSectionTask( templateTaskName + "ArrayIterator", HttpTemplateArrayIteratorWorkSource.TASK_NAME); arrayIteratorTask.getTaskObject(HttpTemplateArrayIteratorWorkSource.OBJECT_NAME) urlContinuationWork.addProperty(HttpUrlContinuationWorkSource.PROPERTY_URI_PATH, linkUriPath); if (isLinkSecure) { urlContinuationWork.addProperty(HttpUrlContinuationWorkSource.PROPERTY_SECURE, String.valueOf(isLinkSecure)); .addSectionTask(linkUrlContinuationPrefix + linkTaskName, HttpUrlContinuationWorkSource.TASK_NAME);
SectionTask routeTask = routeWork.addSectionTask("route", ServletRouteWorkSource.TASK_ROUTE); designer.link(serviceInput, routeTask); designer.link(routeTask.getTaskFlow(FlowKeys.UNHANDLED.name()), unhandledOutput, servlet.addProperty(HttpServletWorkSource.PROPERTY_SERVLET_NAME, servletName); servlet.addProperty(HttpServletWorkSource.PROPERTY_HTTP_SERVLET_CLASS_NAME, servletClass); servlet.addProperty(HttpServletWorkSource.PROPERTY_SERVLET_MAPPINGS, servletUrlPatterns); servlet.addProperty(HttpServletWorkSource.PROPERTY_PREFIX_INIT_PARAMETER + initParam.getName(), initParam.getValue()); SectionTask servletTask = servlet.addSectionTask("service-by-" + servletName, HttpServletTask.TASK_NAME); servletTask.getTaskObject(DependencyKeys.SERVICER_MAPPING.name()).flagAsParameter();
work.addProperty(HttpSecurityWorkSource.PROPERTY_HTTP_SECURITY_SOURCE_KEY, key); SectionTask challengeTask = work.addSectionTask(HttpSecurityWorkSource.TASK_CHALLENGE, HttpSecurityWorkSource.TASK_CHALLENGE); challengeTask.getTaskObject("HTTP_AUTHENTICATION_REQUIRED_EXCEPTION").flagAsParameter(); SectionTask moAuthTask = work.addSectionTask(HttpSecurityWorkSource.TASK_MANAGED_OBJECT_AUTHENTICATE, HttpSecurityWorkSource.TASK_MANAGED_OBJECT_AUTHENTICATE); moAuthTask.getTaskObject("TASK_AUTHENTICATE_CONTEXT").flagAsParameter(); SectionTask moLogoutTask = work.addSectionTask(HttpSecurityWorkSource.TASK_MANAGED_OBJECT_LOGOUT, HttpSecurityWorkSource.TASK_MANAGED_OBJECT_LOGOUT); moLogoutTask.getTaskObject("TASK_LOGOUT_CONTEXT").flagAsParameter(); SectionTask startAuthTask = work.addSectionTask(HttpSecurityWorkSource.TASK_START_APPLICATION_AUTHENTICATE, HttpSecurityWorkSource.TASK_START_APPLICATION_AUTHENTICATE); startAuthTask.getTaskObject(StartApplicationHttpAuthenticateTask.Dependencies.CREDENTIALS.name()) SectionTask completeAuthTask = work.addSectionTask( HttpSecurityWorkSource.TASK_COMPLETE_APPLICATION_AUTHENTICATE, HttpSecurityWorkSource.TASK_COMPLETE_APPLICATION_AUTHENTICATE);