This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 37759 - too many instances created, too many interfaces
Summary: too many instances created, too many interfaces
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P4 blocker (vote)
Assignee: Pavel Buzek
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2003-12-04 20:22 UTC by Pavel Buzek
Modified: 2004-01-13 17:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Buzek 2003-12-04 20:22:54 UTC
Registration of instances via deployment file
results in unnecessary instance created. If
multiple interfaces are implemented by the same
class it would be valuable to reuse them. Another
problem is that even instances of the same
interface are not cached.

With StartTomcat implementing multiple interfaces
there are 9 instances of StartTomcat created for
interfaces StartServer, IncrementalDeployment,
FileDeploymentLayout, ModuleURLResolver,
DeploymentPlanSplitter.

Another important question is if these interfaces
really require this level of granularity. I had to
implement all of them to get incremental
deployment working, it only took me time to figure
this out. If there was one (or a smaller number
of) interface(s) with all the methods it would
have been easier.
Comment 1 Pavel Buzek 2003-12-06 05:00:34 UTC
the problem of multiple instances can be solved easilly if the
registration mechanism was replaced with the netbeans standard (module
layer)
Comment 2 Pavel Buzek 2003-12-10 05:17:24 UTC
I accidently removed the dependency.
Comment 3 Pavel Buzek 2003-12-13 07:03:18 UTC
added code that reads the instance from layer file, 


keeping the existing way still open -- remove before 3.6!
Comment 4 Pavel Buzek 2004-01-13 17:46:41 UTC
as part of plugins api cleanup, the registration mechanism was changed
as follows:

1. where there needs to be one instance per plugin it will be in
module layer

2. where there can be multiple instances which need to be parametrized
there is a factory patter, the factory is registered in layer and
creates the other instances. This is the case for registry nodes and
the former DepoymentManagerWrapper subclasses.

3. for the remaining stuff (such as names, string, ..) there is the
netbeans-deployment file