Revert unintentional code formatting
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@566108 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java b/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java
index 9590d69..91aa1d5 100644
--- a/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java
@@ -90,13 +90,13 @@
*/
protected AbstractComponentManager(BundleComponentActivator activator, ComponentMetadata metadata)
{
- this.m_activator = activator;
- this.m_componentMetadata = metadata;
+ m_activator = activator;
+ m_componentMetadata = metadata;
- this.m_state = STATE_DISABLED;
- this.m_dependencyManagers = new ArrayList();
+ m_state = STATE_DISABLED;
+ m_dependencyManagers = new ArrayList();
- Activator.trace("Component created", this.m_componentMetadata);
+ Activator.trace("Component created", m_componentMetadata);
}
//---------- Asynchronous frontend to state change methods ----------------
@@ -144,7 +144,7 @@
*/
public final void reconfigure()
{
- Activator.trace( "Deactivating and Activating to reconfigure", this.m_componentMetadata );
+ Activator.trace( "Deactivating and Activating to reconfigure", m_componentMetadata );
this.reactivate();
}
@@ -223,23 +223,23 @@
if (this.getState() == STATE_DESTROYED)
{
- Activator.error( "Destroyed Component cannot be enabled", this.m_componentMetadata );
+ Activator.error( "Destroyed Component cannot be enabled", m_componentMetadata );
return;
}
else if (this.getState() != STATE_DISABLED)
{
- Activator.trace( "Component is already enabled", this.m_componentMetadata );
+ Activator.trace( "Component is already enabled", m_componentMetadata );
return;
}
- Activator.trace("Enabling component", this.m_componentMetadata);
+ Activator.trace("Enabling component", m_componentMetadata);
try
{
// If this component has got dependencies, create dependency managers for each one of them.
- if (this.m_componentMetadata.getDependencies().size() != 0)
+ if (m_componentMetadata.getDependencies().size() != 0)
{
- Iterator dependencyit = this.m_componentMetadata.getDependencies().iterator();
+ Iterator dependencyit = m_componentMetadata.getDependencies().iterator();
while(dependencyit.hasNext())
{
@@ -247,21 +247,21 @@
DependencyManager depmanager = new DependencyManager(this, currentdependency);
- this.m_dependencyManagers.add(depmanager);
+ m_dependencyManagers.add(depmanager);
}
}
// enter enabled state before trying to activate
this.setState( STATE_ENABLED );
- Activator.trace("Component enabled", this.m_componentMetadata);
+ Activator.trace("Component enabled", m_componentMetadata);
// immediately activate the compopnent, no need to schedule again
this.activateInternal();
}
catch(Exception ex)
{
- Activator.exception( "Failed enabling Component", this.m_componentMetadata, ex );
+ Activator.exception( "Failed enabling Component", m_componentMetadata, ex );
// ensure we get back to DISABLED state
// immediately disable, no need to schedule again
@@ -293,18 +293,18 @@
// go to the activating state
this.setState(STATE_ACTIVATING);
- Activator.trace("Activating component", this.m_componentMetadata);
+ Activator.trace("Activating component", m_componentMetadata);
// Before creating the implementation object, we are going to
// test if all the mandatory dependencies are satisfied
- Iterator it = this.m_dependencyManagers.iterator();
+ Iterator it = m_dependencyManagers.iterator();
while (it.hasNext())
{
DependencyManager dm = (DependencyManager)it.next();
if (!dm.isValid())
{
// at least one dependency is not satisfied
- Activator.trace( "Dependency not satisfied: " + dm.getName(), this.m_componentMetadata );
+ Activator.trace( "Dependency not satisfied: " + dm.getName(), m_componentMetadata );
this.setState(STATE_UNSATISFIED);
return;
}
@@ -322,9 +322,9 @@
this.setState(this.getSatisfiedState());
// 5. Register provided services
- this.m_serviceRegistration = this.registerComponentService();
+ m_serviceRegistration = this.registerComponentService();
- Activator.trace("Component activated", this.m_componentMetadata);
+ Activator.trace("Component activated", m_componentMetadata);
}
/**
@@ -349,7 +349,7 @@
// start deactivation by resetting the state
this.setState( STATE_DEACTIVATING );
- Activator.trace("Deactivating component", this.m_componentMetadata);
+ Activator.trace("Deactivating component", m_componentMetadata);
// 0.- Remove published services from the registry
this.unregisterComponentService();
@@ -364,7 +364,7 @@
// reset to state UNSATISFIED
this.setState( STATE_UNSATISFIED );
- Activator.trace("Component deactivated", this.m_componentMetadata);
+ Activator.trace("Component deactivated", m_componentMetadata);
}
private void disableInternal()
@@ -375,22 +375,22 @@
// deactivate first, this does nothing if not active/registered/factory
this.deactivateInternal();
- Activator.trace("Disabling component", this.m_componentMetadata);
+ Activator.trace("Disabling component", m_componentMetadata);
// close all service listeners now, they are recreated on enable
// Stop the dependency managers to listen to events...
- Iterator it = this.m_dependencyManagers.iterator();
+ Iterator it = m_dependencyManagers.iterator();
while (it.hasNext())
{
DependencyManager dm = (DependencyManager)it.next();
dm.close();
}
- this.m_dependencyManagers.clear();
+ m_dependencyManagers.clear();
// we are now disabled, ready for re-enablement or complete destroyal
this.setState( STATE_DISABLED );
- Activator.trace("Component disabled", this.m_componentMetadata);
+ Activator.trace("Component disabled", m_componentMetadata);
}
/**
@@ -408,10 +408,10 @@
this.setState( STATE_DESTROYED );
// release references (except component metadata for logging purposes)
- this.m_activator = null;
- this.m_dependencyManagers = null;
+ m_activator = null;
+ m_dependencyManagers = null;
- Activator.trace("Component disposed", this.m_componentMetadata);
+ Activator.trace("Component disposed", m_componentMetadata);
}
//---------- Component handling methods ----------------------------------
@@ -451,11 +451,11 @@
* @return
*/
private int getSatisfiedState() {
- if (this.m_componentMetadata.isFactory())
+ if (m_componentMetadata.isFactory())
{
return STATE_FACTORY;
}
- else if (this.m_componentMetadata.isImmediate())
+ else if (m_componentMetadata.isImmediate())
{
return STATE_ACTIVE;
}
@@ -484,10 +484,10 @@
protected void unregisterComponentService()
{
- if ( this.m_serviceRegistration != null )
+ if ( m_serviceRegistration != null )
{
- this.m_serviceRegistration.unregister();
- this.m_serviceRegistration = null;
+ m_serviceRegistration.unregister();
+ m_serviceRegistration = null;
Activator.trace( "unregistering the services", this.getComponentMetadata() );
}
@@ -496,11 +496,11 @@
//**********************************************************************************************************
BundleComponentActivator getActivator() {
- return this.m_activator;
+ return m_activator;
}
Iterator getDependencyManagers() {
- return this.m_dependencyManagers.iterator();
+ return m_dependencyManagers.iterator();
}
DependencyManager getDependencyManager( String name )
@@ -562,28 +562,28 @@
}
ServiceReference getServiceReference() {
- return ( this.m_serviceRegistration != null ) ? this.m_serviceRegistration.getReference() : null;
+ return ( m_serviceRegistration != null ) ? m_serviceRegistration.getReference() : null;
}
/**
*
*/
public ComponentMetadata getComponentMetadata() {
- return this.m_componentMetadata;
+ return m_componentMetadata;
}
int getState() {
- return this.m_state;
+ return m_state;
}
/**
* sets the state of the manager
**/
protected synchronized void setState(int newState) {
- Activator.trace( "State transition : " + this.stateToString( this.m_state ) + " -> " + this.stateToString( newState ),
- this.m_componentMetadata );
+ Activator.trace( "State transition : " + this.stateToString( m_state ) + " -> " + this.stateToString( newState ),
+ m_componentMetadata );
- this.m_state = newState;
+ m_state = newState;
}
public String stateToString(int state) {
diff --git a/scr/src/main/java/org/apache/felix/scr/ComponentFactoryImpl.java b/scr/src/main/java/org/apache/felix/scr/ComponentFactoryImpl.java
index 4858c3b..63afd4c 100644
--- a/scr/src/main/java/org/apache/felix/scr/ComponentFactoryImpl.java
+++ b/scr/src/main/java/org/apache/felix/scr/ComponentFactoryImpl.java
@@ -57,8 +57,8 @@
ComponentRegistry componentRegistry )
{
super( activator, metadata );
- this.m_componentRegistry = componentRegistry;
- this.m_createdComponents = new IdentityHashMap();
+ m_componentRegistry = componentRegistry;
+ m_createdComponents = new IdentityHashMap();
}
@@ -126,13 +126,13 @@
public void updated( String pid, Dictionary configuration )
{
ComponentManager cm;
- if ( this.m_configuredServices != null )
+ if ( m_configuredServices != null )
{
- cm = ( ComponentManager ) this.m_configuredServices.get( pid );
+ cm = ( ComponentManager ) m_configuredServices.get( pid );
}
else
{
- this.m_configuredServices = new HashMap();
+ m_configuredServices = new HashMap();
cm = null;
}
@@ -142,7 +142,7 @@
cm = this.createComponentManager( configuration );
// keep a reference for future updates
- this.m_configuredServices.put( pid, cm );
+ m_configuredServices.put( pid, cm );
}
else
{
@@ -160,9 +160,9 @@
public void deleted( String pid )
{
- if ( this.m_configuredServices != null )
+ if ( m_configuredServices != null )
{
- ComponentManager cm = ( ComponentManager ) this.m_configuredServices.remove( pid );
+ ComponentManager cm = ( ComponentManager ) m_configuredServices.remove( pid );
if ( cm != null )
{
this.disposeComponentManager( cm );
@@ -187,14 +187,14 @@
*/
private ComponentManager createComponentManager( Dictionary configuration )
{
- long componentId = this.m_componentRegistry.createComponentId();
+ long componentId = m_componentRegistry.createComponentId();
ComponentManager cm = ManagerFactory.createManager( this.getActivator(), this.getComponentMetadata(), componentId );
// add the new component to the activators instances
this.getActivator().getInstanceReferences().add( cm );
// register with the internal set of created components
- this.m_createdComponents.put(cm, cm);
+ m_createdComponents.put(cm, cm);
// inject configuration if possible
if ( cm instanceof ImmediateComponentManager )
@@ -210,7 +210,7 @@
private void disposeComponentManager(ComponentManager cm) {
// remove from created components
- this.m_createdComponents.remove( cm );
+ m_createdComponents.remove( cm );
// remove from activators list
this.getActivator().getInstanceReferences().remove( cm );
diff --git a/scr/src/main/java/org/apache/felix/scr/ComponentRegistry.java b/scr/src/main/java/org/apache/felix/scr/ComponentRegistry.java
index 7e775ab..2f53bee 100644
--- a/scr/src/main/java/org/apache/felix/scr/ComponentRegistry.java
+++ b/scr/src/main/java/org/apache/felix/scr/ComponentRegistry.java
@@ -52,22 +52,22 @@
ComponentRegistry( BundleContext context )
{
- this.m_componentNames = new HashMap();
- this.m_componentCounter = -1;
+ m_componentNames = new HashMap();
+ m_componentCounter = -1;
Dictionary props = new Hashtable();
props.put( Constants.SERVICE_DESCRIPTION, "Service Component Configuration Support" );
props.put( Constants.SERVICE_VENDOR, "Apache Software Foundation" );
- this.registration = context.registerService( ConfigurationListener.class.getName(), this, props );
+ registration = context.registerService( ConfigurationListener.class.getName(), this, props );
}
void dispose()
{
- if ( this.registration != null )
+ if ( registration != null )
{
- this.registration.unregister();
- this.registration = null;
+ registration.unregister();
+ registration = null;
}
}
@@ -89,39 +89,39 @@
long createComponentId()
{
- this.m_componentCounter++;
- return this.m_componentCounter;
+ m_componentCounter++;
+ return m_componentCounter;
}
void checkComponentName( String name )
{
- if ( this.m_componentNames.containsKey( name ) )
+ if ( m_componentNames.containsKey( name ) )
{
throw new ComponentException( "The component name '" + name + "' has already been registered." );
}
// reserve the name
- this.m_componentNames.put( name, name );
+ m_componentNames.put( name, name );
}
void registerComponent( String name, ComponentManager component )
{
// only register the component if there is a registration for it !
- if ( !name.equals( this.m_componentNames.get( name ) ) )
+ if ( !name.equals( m_componentNames.get( name ) ) )
{
// this is not expected if all works ok
throw new ComponentException( "The component name '" + name + "' has already been registered." );
}
- this.m_componentNames.put( name, component );
+ m_componentNames.put( name, component );
}
ComponentManager getComponent( String name )
{
- Object entry = this.m_componentNames.get( name );
+ Object entry = m_componentNames.get( name );
// only return the entry if non-null and not a reservation
if ( entry instanceof ComponentManager )
@@ -135,6 +135,6 @@
void unregisterComponent( String name )
{
- this.m_componentNames.remove( name );
+ m_componentNames.remove( name );
}
}
diff --git a/scr/src/main/java/org/apache/felix/scr/DependencyManager.java b/scr/src/main/java/org/apache/felix/scr/DependencyManager.java
index 128b7ac..31cb787 100644
--- a/scr/src/main/java/org/apache/felix/scr/DependencyManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/DependencyManager.java
@@ -67,10 +67,10 @@
DependencyManager( AbstractComponentManager componentManager, ReferenceMetadata dependency )
throws InvalidSyntaxException
{
- this.m_componentManager = componentManager;
- this.m_dependencyMetadata = dependency;
- this.m_bindUsesServiceReference = false;
- this.m_tracked = new HashMap();
+ m_componentManager = componentManager;
+ m_dependencyMetadata = dependency;
+ m_bindUsesServiceReference = false;
+ m_tracked = new HashMap();
// register the service listener
String filterString = "(" + Constants.OBJECTCLASS + "=" + dependency.getInterface() + ")";
@@ -117,12 +117,12 @@
*/
void close()
{
- BundleContext context = this.m_componentManager.getActivator().getBundleContext();
+ BundleContext context = m_componentManager.getActivator().getBundleContext();
context.removeServiceListener( this );
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- for ( Iterator ri = this.m_tracked.keySet().iterator(); ri.hasNext(); )
+ for ( Iterator ri = m_tracked.keySet().iterator(); ri.hasNext(); )
{
ServiceReference sr = ( ServiceReference ) ri.next();
context.ungetService( sr );
@@ -137,9 +137,9 @@
*/
int size()
{
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- return this.m_tracked.size();
+ return m_tracked.size();
}
}
@@ -149,11 +149,11 @@
*/
ServiceReference getServiceReference()
{
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- if ( this.m_tracked.size() > 0 )
+ if ( m_tracked.size() > 0 )
{
- return ( ServiceReference ) this.m_tracked.keySet().iterator().next();
+ return ( ServiceReference ) m_tracked.keySet().iterator().next();
}
return null;
@@ -167,11 +167,11 @@
*/
ServiceReference[] getServiceReferences()
{
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- if ( this.m_tracked.size() > 0 )
+ if ( m_tracked.size() > 0 )
{
- return ( ServiceReference[] ) this.m_tracked.keySet().toArray( new ServiceReference[this.m_tracked.size()] );
+ return ( ServiceReference[] ) m_tracked.keySet().toArray( new ServiceReference[m_tracked.size()] );
}
return null;
@@ -184,9 +184,9 @@
*/
Object getService( ServiceReference serviceReference )
{
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- return this.m_tracked.get( serviceReference );
+ return m_tracked.get( serviceReference );
}
}
@@ -196,11 +196,11 @@
*/
Object getService()
{
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- if ( this.m_tracked.size() > 0 )
+ if ( m_tracked.size() > 0 )
{
- return this.m_tracked.values().iterator().next();
+ return m_tracked.values().iterator().next();
}
return null;
@@ -214,11 +214,11 @@
*/
Object[] getServices()
{
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- if ( this.m_tracked.size() > 0 )
+ if ( m_tracked.size() > 0 )
{
- return this.m_tracked.values().toArray( new ServiceReference[this.m_tracked.size()] );
+ return m_tracked.values().toArray( new ServiceReference[m_tracked.size()] );
}
return null;
@@ -233,7 +233,7 @@
*/
String getName()
{
- return this.m_dependencyMetadata.getName();
+ return m_dependencyMetadata.getName();
}
@@ -243,7 +243,7 @@
*/
boolean isValid()
{
- return this.size() > 0 || this.m_dependencyMetadata.isOptional();
+ return this.size() > 0 || m_dependencyMetadata.isOptional();
}
@@ -278,7 +278,7 @@
int max = 1;
boolean retval = true;
- if ( this.m_dependencyMetadata.isMultiple() == true )
+ if ( m_dependencyMetadata.isMultiple() == true )
{
max = refs.length;
}
@@ -290,7 +290,7 @@
{
// There was an exception when calling the bind method
Activator.error( "Dependency Manager: Possible exception in the bind method during initialize()",
- this.m_componentManager.getComponentMetadata() );
+ m_componentManager.getComponentMetadata() );
return false;
}
}
@@ -355,7 +355,7 @@
method = AbstractComponentManager.getMethod( targetClass, methodname, new Class[]
{ ServiceReference.class } );
- this.m_bindUsesServiceReference = true;
+ m_bindUsesServiceReference = true;
}
catch ( NoSuchMethodException ex )
{
@@ -364,9 +364,9 @@
{
// Case2
- this.m_bindUsesServiceReference = false;
+ m_bindUsesServiceReference = false;
- parameterClass = this.m_componentManager.getActivator().getBundleContext().getBundle().loadClass(
+ parameterClass = m_componentManager.getActivator().getBundleContext().getBundle().loadClass(
parameterClassName );
method = AbstractComponentManager.getMethod( targetClass, methodname, new Class[]
@@ -425,7 +425,7 @@
}
catch ( ClassNotFoundException ex2 )
{
- Activator.exception( "Cannot load class used as parameter " + parameterClassName, this.m_componentManager
+ Activator.exception( "Cannot load class used as parameter " + parameterClassName, m_componentManager
.getComponentMetadata(), ex2 );
}
}
@@ -457,10 +457,10 @@
try
{
// Get the bind method
- Activator.trace( "getting bind: " + this.m_dependencyMetadata.getBind(), this.m_componentManager
+ Activator.trace( "getting bind: " + m_dependencyMetadata.getBind(), m_componentManager
.getComponentMetadata() );
- Method bindMethod = this.getBindingMethod( this.m_dependencyMetadata.getBind(), implementationObject.getClass(),
- this.m_dependencyMetadata.getInterface() );
+ Method bindMethod = this.getBindingMethod( m_dependencyMetadata.getBind(), implementationObject.getClass(),
+ m_dependencyMetadata.getInterface() );
if ( bindMethod == null )
{
@@ -468,14 +468,14 @@
// error
// message with the log service, if present, and ignore the
// method
- Activator.error( "bind() method not found", this.m_componentManager.getComponentMetadata() );
+ Activator.error( "bind() method not found", m_componentManager.getComponentMetadata() );
return false;
}
// Get the parameter
Object parameter;
- if ( this.m_bindUsesServiceReference == false )
+ if ( m_bindUsesServiceReference == false )
{
parameter = service;
}
@@ -488,7 +488,7 @@
bindMethod.invoke( implementationObject, new Object[]
{ parameter } );
- Activator.trace( "bound: " + this.getName(), this.m_componentManager.getComponentMetadata() );
+ Activator.trace( "bound: " + this.getName(), m_componentManager.getComponentMetadata() );
return true;
}
@@ -498,17 +498,17 @@
// public, SCR must log an error
// message with the log service, if present, and ignore the
// method
- Activator.exception( "bind() method cannot be called", this.m_componentManager.getComponentMetadata(), ex );
+ Activator.exception( "bind() method cannot be called", m_componentManager.getComponentMetadata(), ex );
return false;
}
catch ( InvocationTargetException ex )
{
- Activator.exception( "DependencyManager : exception while invoking " + this.m_dependencyMetadata.getBind()
- + "()", this.m_componentManager.getComponentMetadata(), ex );
+ Activator.exception( "DependencyManager : exception while invoking " + m_dependencyMetadata.getBind()
+ + "()", m_componentManager.getComponentMetadata(), ex );
return false;
}
}
- else if ( implementationObject == null && this.m_componentManager.getComponentMetadata().isImmediate() == false )
+ else if ( implementationObject == null && m_componentManager.getComponentMetadata().isImmediate() == false )
{
return true;
}
@@ -537,16 +537,16 @@
{
try
{
- Activator.trace( "getting unbind: " + this.m_dependencyMetadata.getUnbind(), this.m_componentManager
+ Activator.trace( "getting unbind: " + m_dependencyMetadata.getUnbind(), m_componentManager
.getComponentMetadata() );
- Method unbindMethod = this.getBindingMethod( this.m_dependencyMetadata.getUnbind(), implementationObject
- .getClass(), this.m_dependencyMetadata.getInterface() );
+ Method unbindMethod = this.getBindingMethod( m_dependencyMetadata.getUnbind(), implementationObject
+ .getClass(), m_dependencyMetadata.getInterface() );
// Recover the object that is bound from the map.
// Object parameter = m_boundServices.get(ref);
Object parameter = null;
- if ( this.m_bindUsesServiceReference == true )
+ if ( m_bindUsesServiceReference == true )
{
parameter = ref;
}
@@ -561,14 +561,14 @@
// error
// message with the log service, if present, and ignore the
// method
- Activator.error( "unbind() method not found", this.m_componentManager.getComponentMetadata() );
+ Activator.error( "unbind() method not found", m_componentManager.getComponentMetadata() );
return false;
}
unbindMethod.invoke( implementationObject, new Object[]
{ parameter } );
- Activator.trace( "unbound: " + this.getName(), this.m_componentManager.getComponentMetadata() );
+ Activator.trace( "unbound: " + this.getName(), m_componentManager.getComponentMetadata() );
return true;
}
@@ -578,18 +578,18 @@
// public, SCR must log an error
// message with the log service, if present, and ignore the
// method
- Activator.exception( "unbind() method cannot be called", this.m_componentManager.getComponentMetadata(), ex );
+ Activator.exception( "unbind() method cannot be called", m_componentManager.getComponentMetadata(), ex );
return false;
}
catch ( InvocationTargetException ex )
{
- Activator.exception( "DependencyManager : exception while invoking " + this.m_dependencyMetadata.getUnbind()
- + "()", this.m_componentManager.getComponentMetadata(), ex );
+ Activator.exception( "DependencyManager : exception while invoking " + m_dependencyMetadata.getUnbind()
+ + "()", m_componentManager.getComponentMetadata(), ex );
return false;
}
}
- else if ( implementationObject == null && this.m_componentManager.getComponentMetadata().isImmediate() == false )
+ else if ( implementationObject == null && m_componentManager.getComponentMetadata().isImmediate() == false )
{
return true;
}
@@ -605,10 +605,10 @@
private void addingService( ServiceReference reference )
{
// get the service and keep it here (for now or later)
- Object service = this.m_componentManager.getActivator().getBundleContext().getService( reference );
- synchronized ( this.m_tracked )
+ Object service = m_componentManager.getActivator().getBundleContext().getService( reference );
+ synchronized ( m_tracked )
{
- this.m_tracked.put( reference, service );
+ m_tracked.put( reference, service );
}
// forward the event if in event handling state
@@ -618,25 +618,25 @@
// the component is UNSATISFIED if enabled but any of the references
// have been missing when activate was running the last time or
// the component has been deactivated
- if ( this.m_componentManager.getState() == AbstractComponentManager.STATE_UNSATISFIED )
+ if ( m_componentManager.getState() == AbstractComponentManager.STATE_UNSATISFIED )
{
- this.m_componentManager.activate();
+ m_componentManager.activate();
}
// Otherwise, this checks for dynamic 0..1, 0..N, and 1..N
// it never
// checks for 1..1 dynamic which is done above by the
// validate()
- else if ( !this.m_dependencyMetadata.isStatic() )
+ else if ( !m_dependencyMetadata.isStatic() )
{
// For dependency that are aggregates, always bind the
// service
// Otherwise only bind if bind services is zero, which
// captures the 0..1 case
// (size is still zero as we are called for the first service)
- if ( this.m_dependencyMetadata.isMultiple() || this.size() == 0 )
+ if ( m_dependencyMetadata.isMultiple() || this.size() == 0 )
{
- this.invokeBindMethod( this.m_componentManager.getInstance(), reference, service );
+ this.invokeBindMethod( m_componentManager.getInstance(), reference, service );
}
}
}
@@ -647,9 +647,9 @@
{
// remove the service from the internal registry, ignore if not cached
Object service;
- synchronized ( this.m_tracked )
+ synchronized ( m_tracked )
{
- service = this.m_tracked.remove( reference );
+ service = m_tracked.remove( reference );
}
// do nothing in the unlikely case that we do not have it cached
@@ -662,18 +662,18 @@
{
// A static dependency is broken the instance manager will
// be invalidated
- if ( this.m_dependencyMetadata.isStatic() )
+ if ( m_dependencyMetadata.isStatic() )
{
// setStateDependency(DependencyChangeEvent.DEPENDENCY_INVALID);
try
{
- Activator.trace( "Dependency Manager: Static dependency is broken", this.m_componentManager
+ Activator.trace( "Dependency Manager: Static dependency is broken", m_componentManager
.getComponentMetadata() );
- this.m_componentManager.reactivate();
+ m_componentManager.reactivate();
}
catch ( Exception ex )
{
- Activator.exception( "Exception while recreating dependency ", this.m_componentManager
+ Activator.exception( "Exception while recreating dependency ", m_componentManager
.getComponentMetadata(), ex );
}
}
@@ -683,7 +683,7 @@
// Release references to the service, call unbinder
// method
// and eventually request service unregistration
- Object instance = this.m_componentManager.getInstance();
+ Object instance = m_componentManager.getInstance();
this.invokeUnbindMethod( instance, reference, service );
// The only thing we need to do here is check if we can
@@ -700,13 +700,13 @@
// try to reinitialize
if ( !this.bind( instance ) )
{
- if ( !this.m_dependencyMetadata.isOptional() )
+ if ( !m_dependencyMetadata.isOptional() )
{
Activator
.trace(
"Dependency Manager: Mandatory dependency not fullfilled and no replacements available... unregistering service...",
- this.m_componentManager.getComponentMetadata() );
- this.m_componentManager.reactivate();
+ m_componentManager.getComponentMetadata() );
+ m_componentManager.reactivate();
}
}
}
@@ -714,13 +714,13 @@
}
// finally unget the service
- this.m_componentManager.getActivator().getBundleContext().ungetService( reference );
+ m_componentManager.getActivator().getBundleContext().ungetService( reference );
}
private boolean handleServiceEvent()
{
- return ( this.m_componentManager.getState() & STATE_MASK ) != 0;
+ return ( m_componentManager.getState() & STATE_MASK ) != 0;
// return state != AbstractComponentManager.INSTANCE_DESTROYING
// && state != AbstractComponentManager.INSTANCE_DESTROYED
// && state != AbstractComponentManager.INSTANCE_CREATING
diff --git a/scr/src/main/java/org/apache/felix/scr/ImmediateComponentManager.java b/scr/src/main/java/org/apache/felix/scr/ImmediateComponentManager.java
index 022fd1e..1c5e563 100644
--- a/scr/src/main/java/org/apache/felix/scr/ImmediateComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/ImmediateComponentManager.java
@@ -62,7 +62,7 @@
{
super(activator, metadata);
- this.m_componentId = componentId;
+ m_componentId = componentId;
}
@@ -80,16 +80,16 @@
// if something failed craeating the object, we fell back to
// unsatisfied !!
if (tmpComponent != null) {
- this.m_componentContext = tmpContext;
- this.m_implementationObject = tmpComponent;
+ m_componentContext = tmpContext;
+ m_implementationObject = tmpComponent;
}
}
protected void deleteComponent() {
- this.disposeImplementationObject( this.m_implementationObject, this.m_componentContext );
- this.m_implementationObject = null;
- this.m_componentContext = null;
- this.m_properties = null;
+ this.disposeImplementationObject( m_implementationObject, m_componentContext );
+ m_implementationObject = null;
+ m_componentContext = null;
+ m_properties = null;
}
@@ -101,7 +101,7 @@
* @return the object that implements the services
*/
public Object getInstance() {
- return this.m_implementationObject;
+ return m_implementationObject;
}
protected Object createImplementationObject(ComponentContext componentContext) {
@@ -224,11 +224,11 @@
* factory component.
*/
protected Object getService() {
- return this.m_implementationObject;
+ return m_implementationObject;
}
protected void setFactoryProperties(Dictionary dictionary) {
- this.m_factoryProperties = this.copyTo( null, dictionary );
+ m_factoryProperties = this.copyTo( null, dictionary );
}
/**
@@ -245,7 +245,7 @@
// TODO: Currently on ManagedService style configuration is supported, ManagedServiceFactory style is missing
- if ( this.m_properties == null )
+ if ( m_properties == null )
{
// 1. the properties from the component descriptor
@@ -269,16 +269,16 @@
}
// 3. copy any component factory properties, not supported yet
- this.copyTo( props, this.m_factoryProperties );
+ this.copyTo( props, m_factoryProperties );
// 4. set component.name and component.id
props.put( ComponentConstants.COMPONENT_NAME, this.getComponentMetadata().getName() );
- props.put( ComponentConstants.COMPONENT_ID, new Long( this.m_componentId ) );
+ props.put( ComponentConstants.COMPONENT_ID, new Long( m_componentId ) );
- this.m_properties = props;
+ m_properties = props;
}
- return this.m_properties;
+ return m_properties;
}
}