On Wed, Jan 10, 2018 at 7:50 AM, Neil Bartlett <[email protected]> wrote:

> I don't have much experience with Component Factories. I can try it out...
> if you have a sample bundle that I can test against that would be helpful.
>

Ok, I can put something simple together.

I know they are not much used, but since we made an update for these in the
latest DS spec w.r.t. factory configuration defaults I think it starts to
make more sense to include them in any reporting also.

- Ray


>
> Neil
>
> On Wed, Jan 10, 2018 at 12:25 PM, Raymond Auge <[email protected]>
> wrote:
>
> > +1
> >
> > I've been meaning for a long time to improve the output. Yours looks very
> > good.
> >
> > Does it support component factory instances? I don't think the original
> one
> > does.
> >
> > - Ray
> >
> > On Wed, Jan 10, 2018 at 4:40 AM, njbartlett <[email protected]> wrote:
> >
> > > GitHub user njbartlett opened a pull request:
> > >
> > >     https://github.com/apache/felix/pull/130
> > >
> > >     New SCR commands
> > >
> > >     New SCR Commands
> > >     ================
> > >
> > >     This is a reimplementation of the `scr:list` and `scr:info`
> commands,
> > > presented in a more compact and accessible way. The proposal is to
> > > implement these commands on the R7 branch only, to be included in SCR
> > 2.1.x.
> > >
> > >     Changes include:
> > >
> > >     - Support for DS 1.4 failed activation state and failure message.
> > >     - Provide information on any service registered by the component,
> > > including service ID and using bundles.
> > >     - The `scr:list` and `scr:info` commands simply return DTO objects
> to
> > > the Gogo Shell. These objects are then formatted by an instance of the
> > > `Converter` service. This is more in keeping with the philosophy of
> Gogo,
> > > since it allows others to write commands that produce DTO objects
> without
> > > having to provide their own formatting.
> > >     - Support for the legacy Felix Shell is dropped, only Gogo is
> > > supported.
> > >
> > >     Example Output
> > >     --------------
> > >
> > >     The following is an example of the output of the new commands:
> > >
> > >
> > >         g!  scr:list
> > >         com.effectiveosgi.rt.aws.s3 in bundle [1]
> > > (com.effectiveosgi.rt.aws:2.0.0.201801100857) enabled, 0 instances.
> > >         com.effectiveosgi.rt.aws.impl.S3ObjectConverter in bundle [1]
> > > (com.effectiveosgi.rt.aws:2.0.0.201801100857) enabled, 1 instance.
> > >             Id: 0, State:ACTIVE
> > >         com.effectiveosgi.ExampleComponent in bundle [6]
> > > (example:1.0.0.201801100858) enabled, 3 instances.
> > >             Id: 1, State:ACTIVE, PID(s): [com.effectiveosgi.
> > > ExampleComponent~three]
> > >             Id: 2, State:ACTIVE, PID(s): [com.effectiveosgi.
> > > ExampleComponent~two]
> > >             Id: 3, State:ACTIVE, PID(s): [com.effectiveosgi.
> > > ExampleComponent~one]
> > >         com.effectiveosgi.SampleRunnable in bundle [6]
> > > (example:1.0.0.201801100858) enabled, 1 instance.
> > >             Id: 4, State:ACTIVE
> > >
> > >         g!  scr:info 4
> > >         Component Description: com.effectiveosgi.SampleRunnable
> > >         =======================================================
> > >         Class:         com.effectiveosgi.SampleRunnable
> > >         Bundle:        6 (example:1.0.0.201801100858)
> > >         Enabled:       true
> > >         Immediate:     false
> > >         Services:      [java.lang.Runnable]
> > >         Scope:         prototype
> > >         Config PID(s): [com.effectiveosgi.SampleRunnable], Policy:
> > > optional
> > >         Base Props:    (0 entries)
> > >
> > >         Component Configuration Id: 4
> > >         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >         State:        ACTIVE
> > >         Service Id:   52 [java.lang.Runnable]
> > >         Used by bundle [6] (example:1.0.0.201801100858)
> > >         Config Props: (2 entries)
> > >         component.id<Long> = 4
> > >         component.name<String> = com.effectiveosgi.SampleRunnable
> > >         References:   (total 0)
> > >
> > >         g!  scr:info 3
> > >         Component Description: com.effectiveosgi.ExampleComponent
> > >         =========================================================
> > >         Class:         com.effectiveosgi.ExampleComponent
> > >         Bundle:        6 (example:1.0.0.201801100858)
> > >         Enabled:       true
> > >         Immediate:     true
> > >         Services:      <<none>>
> > >         Config PID(s): [com.effectiveosgi.ExampleComponent], Policy:
> > > optional
> > >         Base Props:    (0 entries)
> > >
> > >         Component Configuration Id: 3
> > >         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >         State:        ACTIVE
> > >         Config Props: (6 entries)
> > >         _com.effectiveosgi.rt.config.filePath<String> =
> > > /Users/neil.bartlett/Projects/eosgi-runtime/_assembly/load/
> > > http-config.yaml
> > >         component.id<Long> = 3
> > >         component.name<String> = com.effectiveosgi.ExampleComponent
> > >         port<Integer> = 8001
> > >         service.factoryPid<String> = com.effectiveosgi.
> ExampleComponent
> > >         service.pid<String> = com.effectiveosgi.ExampleComponent~one
> > >         References:   (total 1)
> > >         runnable: java.lang.Runnable SATISFIED
> > >             1..1 static target=(*) scope=prototype_required
> > >             Bound to [52] from bundle [6] example:1.0.0.201801100858
> > >
> > >     For reference, here is the equivalent output from the previous
> > command
> > > implementation:
> > >
> > >         g!  scr:list
> > >         BundleId Component Name Default State
> > >             Component Id State      PIDs (Factory PID)
> > >         [   1]   com.effectiveosgi.rt.aws.impl.S3ObjectConverter
> > enabled
> > >             [   0] [active      ]
> > >         [   1]   com.effectiveosgi.rt.aws.s3  enabled
> > >         [   7]   com.effectiveosgi.ExampleComponent  enabled
> > >             [   1] [active      ] com.effectiveosgi.
> > ExampleComponent~three
> > > (com.effectiveosgi.ExampleComponent )
> > >             [   2] [active      ] com.effectiveosgi.
> ExampleComponent~two
> > > (com.effectiveosgi.ExampleComponent )
> > >             [   3] [active      ] com.effectiveosgi.
> ExampleComponent~one
> > > (com.effectiveosgi.ExampleComponent )
> > >         [   7]   com.effectiveosgi.SampleRunnable  enabled
> > >             [   4] [active      ]
> > >         g!  scr:info 4
> > >         *** Bundle: example (7)
> > >         Component Description:
> > >         Name: com.effectiveosgi.SampleRunnable
> > >         Implementation Class: com.effectiveosgi.SampleRunnable
> > >         Default State: enabled
> > >         Activation: delayed
> > >         Configuration Policy: optional
> > >         Activate Method: activate
> > >         Deactivate Method: deactivate
> > >         Modified Method: -
> > >         Configuration Pid: [com.effectiveosgi.SampleRunnable]
> > >         Services:
> > >             java.lang.Runnable
> > >         Service Scope: prototype
> > >         Component Description Properties:
> > >         Component Configuration:
> > >             ComponentId: 4
> > >             State: active
> > >             Component Configuration Properties:
> > >                 component.id = 4
> > >                 component.name = com.effectiveosgi.SampleRunnable
> > >
> > >         g!  scr:info 3
> > >         *** Bundle: example (7)
> > >         Component Description:
> > >         Name: com.effectiveosgi.ExampleComponent
> > >         Implementation Class: com.effectiveosgi.ExampleComponent
> > >         Default State: enabled
> > >         Activation: immediate
> > >         Configuration Policy: optional
> > >         Activate Method: activate
> > >         Deactivate Method: deactivate
> > >         Modified Method: -
> > >         Configuration Pid: [com.effectiveosgi.ExampleComponent]
> > >         Reference: runnable
> > >             Interface Name: java.lang.Runnable
> > >             Cardinality: 1..1
> > >             Policy: static
> > >             Policy option: reluctant
> > >             Reference Scope: prototype_required
> > >         Component Description Properties:
> > >         Component Configuration:
> > >             ComponentId: 3
> > >             State: active
> > >             SatisfiedReference: runnable
> > >             Target: null
> > >             Bound to:        53
> > >             Reference Properties:
> > >                 component.id = 4
> > >                 component.name = com.effectiveosgi.SampleRunnable
> > >                 objectClass = [java.lang.Runnable]
> > >                 service.bundleid = 7
> > >                 service.id = 53
> > >                 service.scope = bundle
> > >             Component Configuration Properties:
> > >                 _com.effectiveosgi.rt.config.filePath =
> > > /Users/neil.bartlett/Projects/eosgi-runtime/_assembly/load/
> > > http-config.yaml
> > >                 component.id = 3
> > >                 component.name = com.effectiveosgi.ExampleComponent
> > >                 port = 8001
> > >                 service.factoryPid = com.effectiveosgi.
> ExampleComponent
> > >                 service.pid = com.effectiveosgi.ExampleComponent~one
> > >
> > >
> > >
> > > You can merge this pull request into a Git repository by running:
> > >
> > >     $ git pull https://github.com/njbartlett/felix scrcommands
> > >
> > > Alternatively you can review and apply these changes as the patch at:
> > >
> > >     https://github.com/apache/felix/pull/130.patch
> > >
> > > To close this pull request, make a commit to your master/trunk branch
> > > with (at least) the following in the commit message:
> > >
> > >     This closes #130
> > >
> > > ----
> > > commit 7a6f6d08008b54c6f3cd272ac3c0540f1b95d22c
> > > Author: Neil Bartlett <njbartlett@...>
> > > Date:   2018-01-10T09:25:00Z
> > >
> > >     New SCR component commands
> > >
> > > ----
> > >
> > >
> > > ---
> > >
> >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)

Reply via email to