Rename SpringApplication Events
Move SpringApplication events to their own package, create a common base class and rename classes to match Spring conventions.pull/302/head
parent
818326d820
commit
92f01cf9bc
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed 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.springframework.boot.event;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* Base class for {@link ApplicationEvent} related to a {@link SpringApplication}.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
public abstract class SpringApplicationEvent extends ApplicationEvent {
|
||||
|
||||
private final String[] args;
|
||||
|
||||
public SpringApplicationEvent(SpringApplication application, String[] args) {
|
||||
super(application);
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
public SpringApplication getSpringApplication() {
|
||||
return (SpringApplication) getSource();
|
||||
}
|
||||
|
||||
public final String[] getArgs() {
|
||||
return this.args;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue