All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wingsource.plugin.impl.link.LinkPlugin Maven / Gradle / Ivy

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.wingsource.plugin.impl.link;

import org.wingsource.plugin.PluginRequest;
import org.wingsource.plugin.PluginResponse;
import org.wingsource.plugin.Plugin;
import org.wingsource.plugin.impl.link.bean.Link;
import org.wingsource.plugin.impl.link.bean.LinkFactory;

import com.google.inject.Guice;
import com.google.inject.Injector;

/**
 * @author samikc
 *
 */
public class LinkPlugin implements Plugin {
	


	/* (non-Javadoc)
	 * @see org.wingsource.plugin.Pluglet#destroy()
	 */
	public void destroy() {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.wingsource.plugin.Pluglet#init()
	 */
	public void init() {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.wingsource.plugin.Pluglet#service(org.wingsource.plugin.PluginRequest, org.wingsource.plugin.PluginResponse)
	 */
	public void service(PluginRequest request, PluginResponse response) {
		String id = (String) request.getAttribute(PluginRequest.ID);
		Injector i = Guice.createInjector(new LinkModule());
		LinkFactory lf = i.getInstance(LinkFactory.class);
		Link[] links = lf.get(id);
		
		response.setResponse(links);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy