Skip to content

Extract Regions from FeaturesServiceImpl#301

Closed
cschneider wants to merge 0 commit intoapache:masterfrom
cschneider:refactoring-feature
Closed

Extract Regions from FeaturesServiceImpl#301
cschneider wants to merge 0 commit intoapache:masterfrom
cschneider:refactoring-feature

Conversation

@cschneider
Copy link
Copy Markdown
Contributor

No description provided.

* to allow this bundle to be stopped and still allow the deployment to
* take place.
*/
private final BundleContext systemBundleContext;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the removal of this javadoc ? It looks important to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the comment to Regions as I think the functionality refered by the comment is also moved. The remaining use of systemBundleContext is in getDeploymentState and I had the impression the comment does not match the usage there.. btw. as only one method uses systemBundleContext we can maybe move it out of FeaturesServiceImpl in a later refactoring.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

boolean configCfgStore) {
this.bundle = bundle;
this.bundleContext = bundleContext;
this.bundleContext = bundle == null ? null : bundle.getBundleContext();
Copy link
Copy Markdown
Contributor

@gnodet gnodet May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather keep the bundleContext as a parameter.
The reason is that bundle.getBundleContext() can possibly throw an exception.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


void saveState() throws IOException;

RegionDigraph getGraph() throws BundleException;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to getDigraphCopy() to better reflect what it actually does ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

import org.osgi.resource.Resource;
import org.osgi.resource.Wire;

public interface Regions {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regions does not sound a very good name to me... Too vague. What about something like RegionInstallationSupport ? Another thought ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also unsure. Not sure if RegionInstallationSupport is better but if you prefer it that is fine for me.


void saveState(State state);
void persistResolveRequest(DeploymentRequest request) throws IOException;
void installFeature(Feature feature) throws IOException, InvalidSyntaxException;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to move the installFeature too, as the DeployCallback would then only contain state and listeners management.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think installFeature is very similar to uninstallFeature. So we would need to move both. If you look what they depend on there would not be much left in FeaturesServiceImpl.

I have some ideas how to improve the situation but they would require a bigger redesign.


public FeaturesServiceImpl(Bundle bundle,
BundleContext bundleContext,
BundleContext systemBundleContext,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can me split out the removal of this constructor in a different commit ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you like it to be separate?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, smaller commits are easier to review imho

import static java.util.jar.JarFile.MANIFEST_NAME;
import aQute.bnd.osgi.Macro;
import aQute.bnd.osgi.Processor;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid reordering imports ?

Copy link
Copy Markdown
Contributor Author

@cschneider cschneider May 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to avoid it. Sometimes I tend to press Ctrl-Shift-O :-)

@cschneider cschneider force-pushed the refactoring-feature branch from 4b5f264 to a1ead3d Compare May 16, 2017 09:41
@cschneider cschneider closed this May 17, 2017
@cschneider cschneider force-pushed the refactoring-feature branch from a1ead3d to 2e8c6ee Compare May 17, 2017 14:22
@cschneider cschneider deleted the refactoring-feature branch May 17, 2017 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants