SectionWork work = designer.addSectionWork(resourcePath, HttpFileWorkSource.class.getName()); SourceHttpResourceFactory.copyProperties(context, work);
SectionWork subscribeWork = designer.addSectionWork("SUBSCRIBE", ClassWorkSource.class.getName()); subscribeWork.addProperty(ClassWorkSource.CLASS_NAME_PROPERTY_NAME, SectionWork publishWork = designer.addSectionWork("PUBLISH_WORK", PublishWorkSource.class.getName()); SectionTask publishTask = publishWork.addSectionTask("PUBLISH",
/** * 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); }
@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); }
SectionWork work = designer.addSectionWork( gwtServiceName, GwtServiceWorkSource.class.getName());
SectionWork initialWork = designer.addSectionWork("INITIAL", HttpTemplateInitialWorkSource.class.getName()); PropertiesUtil.copyProperties(context, initialWork, HttpTemplateWorkSource.PROPERTY_TEMPLATE_URI, HttpTemplateWorkSource.PROPERTY_TEMPLATE_URI_SUFFIX, HttpTemplateWorkSource.PROPERTY_TEMPLATE_SECURE, SectionWork templateWork = designer.addSectionWork(TEMPLATE_WORK_NANE, HttpTemplateWorkSource.class.getName()); templateWork.addProperty(HttpTemplateWorkSource.PROPERTY_TEMPLATE_CONTENT, templateContent); SectionWork arrayIteratorWork = designer.addSectionWork(templateTaskName + "ArrayIterator", HttpTemplateArrayIteratorWorkSource.class.getName()); arrayIteratorWork.addProperty(HttpTemplateArrayIteratorWorkSource.PROPERTY_COMPONENT_TYPE_NAME, SectionWork urlContinuationWork = designer.addSectionWork(linkUrlContinuationPrefix + linkTaskName, HttpUrlContinuationWorkSource.class.getName()); urlContinuationWork.addProperty(HttpUrlContinuationWorkSource.PROPERTY_URI_PATH, linkUriPath);
SectionWork routeWork = designer.addSectionWork("ROUTE", HttpRouteWorkSource.class.getName()); SectionTask routeTask = routeWork.addSectionTask("ROUTE", SectionWork sendResponseWork = designer.addSectionWork("SEND", HttpResponseSenderWorkSource.class.getName()); SectionTask sendResponseTask = sendResponseWork.addSectionTask("SEND",
SectionWork routeWork = designer.addSectionWork("Route", ServletRouteWorkSource.class.getName()); SectionTask routeTask = routeWork.addSectionTask("route", ServletRouteWorkSource.TASK_ROUTE); designer.link(serviceInput, routeTask); SectionWork servlet = designer.addSectionWork(servletName, HttpServletWorkSource.class.getName()); servlet.addProperty(HttpServletWorkSource.PROPERTY_SERVLET_NAME, servletName); servlet.addProperty(HttpServletWorkSource.PROPERTY_HTTP_SERVLET_CLASS_NAME, servletClass);
SectionWork work = designer.addSectionWork("HttpSecuritySource", HttpSecurityWorkSource.class.getName()); work.addProperty(HttpSecurityWorkSource.PROPERTY_HTTP_SECURITY_SOURCE_KEY, key);