net.java.truecommons.services.Decorator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truecommons-services Show documentation
Show all versions of truecommons-services Show documentation
Provides service location which is designed to work well in both JEE
and OSGi environments and perfectly fits the dependency injection idiom
with support for JSR 330.
/*
* Copyright (C) 2012 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truecommons.services;
import javax.annotation.concurrent.ThreadSafe;
/**
* Decorates products.
*
* Implementations should be thread-safe.
*
* @param
the type of the products to decorate.
* @author Christian Schlichtherle
*/
@ThreadSafe
public interface Decorator
extends Function
{
/**
* Possibly decorates the given {@code product} and returns the result,
* leaving the given product unmodified.
*
* @param product the product to decorate.
* @return A new decorating product or the same, but strictly
* unmodified, product.
*/
@Override
P apply(P product);
}