Package org.restlet.ext.osgi.di.junit.support

Source Code of org.restlet.ext.osgi.di.junit.support.TestResource

/*******************************************************************************
* Copyright (c) 2010 Bryan Hunt.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*    Bryan Hunt - initial API and implementation
*******************************************************************************/

package org.restlet.ext.osgi.di.junit.support;

import javax.inject.Inject;

import org.osgi.service.log.LogService;
import org.restlet.ext.osgi.di.eclipse.InjectedServerResource;
import org.restlet.representation.EmptyRepresentation;
import org.restlet.representation.Representation;
import org.restlet.resource.Put;

/**
* @author bhunt
*
*/
public class TestResource extends InjectedServerResource
{
  @Put
  public Representation logData(String data)
  {
    if (logService != null)
      logService.log(LogService.LOG_INFO, data);

    return new EmptyRepresentation();
  }

  @Inject
  LogService logService;
}
TOP

Related Classes of org.restlet.ext.osgi.di.junit.support.TestResource

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.