-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sisu specific PreConstruct/PreDestroy annotations #76
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2010-present Sonatype, Inc. | ||
* 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: | ||
* Stuart McCulloch (Sonatype, Inc.) - initial API and implementation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn’t that be you @cstamas? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
*******************************************************************************/ | ||
package org.eclipse.sisu; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* The PostConstruct annotation is used on a method that needs to be executed | ||
* after dependency injection is done to perform any initialization. This | ||
* method is invoked by Sisu before the class is put into service. | ||
* <p> | ||
* This annotation is Sisu specific annotation, that has same semantics as | ||
* {@link javax.annotation.PostConstruct} annotation has, and may be used | ||
* interchangeably. | ||
* <p> | ||
* To use annotation {@link org.eclipse.sisu.bean.LifecycleModule} needs to be | ||
* installed. | ||
* | ||
* @since TBD | ||
*/ | ||
@Target( value = { ElementType.METHOD } ) | ||
@Retention( RetentionPolicy.RUNTIME ) | ||
@Documented | ||
public @interface PostConstruct { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2010-present Sonatype, Inc. | ||
* 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: | ||
* Stuart McCulloch (Sonatype, Inc.) - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.sisu; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* The PreDestroy annotation is used on methods as a callback notification to | ||
* signal that the instance is in the process of being removed by the | ||
* container. The method annotated with PreDestroy is typically used to | ||
* release resources that it has been holding. | ||
* <p> | ||
* This annotation is Sisu specific annotation, that has same semantics as | ||
* {@link javax.annotation.PreDestroy} annotation has, and may be used | ||
* interchangeably. | ||
* <p> | ||
* To use annotation {@link org.eclipse.sisu.bean.LifecycleModule} needs to be | ||
* installed. | ||
* | ||
* @since TBD | ||
*/ | ||
|
||
@Target( value = { ElementType.METHOD } ) | ||
@Retention( RetentionPolicy.RUNTIME ) | ||
@Documented | ||
public @interface PreDestroy { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,6 @@ | |
*******************************************************************************/ | ||
package org.eclipse.sisu.bean; | ||
|
||
import javax.annotation.PostConstruct; | ||
import javax.annotation.PreDestroy; | ||
|
||
import com.google.inject.Binder; | ||
import com.google.inject.Module; | ||
import com.google.inject.TypeLiteral; | ||
|
@@ -23,8 +20,8 @@ | |
import com.google.inject.spi.TypeListener; | ||
|
||
/** | ||
* Guice {@link Module} that provides JSR250 lifecycle management by following {@link PostConstruct} and | ||
* {@link PreDestroy} annotations. The lifecycle can be controlled with the associated {@link BeanManager}. | ||
* Guice {@link Module} that provides JSR250 lifecycle management by following {@link javax.annotation.PostConstruct} and | ||
* {@link javax.annotation.PreDestroy} annotations. The lifecycle can be controlled with the associated {@link BeanManager}. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or sisu lifecycle annotations! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed, please reread |
||
*/ | ||
public final class LifecycleModule | ||
implements Module | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sonatype copyright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed