Skip to content

Commit

Permalink
Fix #17 cleanup unused API
Browse files Browse the repository at this point in the history
- Renaming RoundEnvironementInternal
- Refactor Context and Context internal
 - remove old method
 - add objectGraph
  • Loading branch information
pith committed Oct 8, 2015
1 parent 1f156e6 commit 5dbab62
Show file tree
Hide file tree
Showing 14 changed files with 1,056 additions and 1,240 deletions.
8 changes: 4 additions & 4 deletions core/src/main/java/io/nuun/kernel/core/AbstractPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import io.nuun.kernel.api.Plugin;
import io.nuun.kernel.api.di.UnitModule;
import io.nuun.kernel.api.plugin.InitState;
import io.nuun.kernel.api.plugin.RoundEnvironment;
import io.nuun.kernel.api.plugin.Round;
import io.nuun.kernel.api.plugin.context.Context;
import io.nuun.kernel.api.plugin.context.InitContext;
import io.nuun.kernel.api.plugin.request.*;
Expand Down Expand Up @@ -48,7 +48,7 @@ public abstract class AbstractPlugin implements Plugin

protected Context context = null;
protected Object containerContext = null;
protected RoundEnvironment roundEnvironment;
protected Round round;

// ============================= PLUGIN LIFE CYCLE USED BY KERNEL =============================

Expand Down Expand Up @@ -288,9 +288,9 @@ public DependencyInjectionProvider dependencyInjectionProvider()
}

@Override
public void provideRoundEnvironment(RoundEnvironment roundEnvironment)
public void provideRoundEnvironment(Round round)
{
this.roundEnvironment = roundEnvironment;
this.round = round;
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright (C) 2013-2014 Kametic <[email protected]>
*
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3, 29 June 2007;
* or any later version
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* 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 io.nuun.kernel.core.internal;

import com.google.inject.Injector;
import io.nuun.kernel.api.di.ObjectGraph;
import io.nuun.kernel.api.plugin.context.Context;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
* @author Epo Jemba
*
*/
@Singleton
public class ContextInternal implements Context
{

public final Injector mainInjector;

/**
* Constructor.
*
* @param mainInjector the guice main injector
*/
@Inject
public ContextInternal(Injector mainInjector)
{
this.mainInjector = mainInjector;
}

@Override
public ObjectGraph applicationObjectGraph() {
return new ObjectGraphEmbedded(mainInjector);
}
}
Loading

0 comments on commit 5dbab62

Please sign in to comment.