"Stephen McConnell" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Eike Stepper wrote: > > > hi, > > > > one of my components is disposed in response to "finalizing a proxy". > > could you please explain what that means and how i can prevent it? > > Use the 'collection' attribute in the @avalon.component declaration. > > E.g.: > > @avalon.component name="whatever" > lifestyle="singleton" collection="hard" > > Allowable options include 'hard', 'soft' and 'weak'. Hard refs will not > be released without an explicit release by the consumer. Soft means > that the component will be garbage collected if no references to the > component exists and a memory contention occurs. Soft means that a > non-referenced component will be released as the discretion of the jvm.
all my components have collection type "hard" since this seems to be the default. this particular component has lifestyle "transient" (i need a new instance on each request). as i told, a handle to the instance (proxy) is stored in a HashMap so that there is always a reference (although the map is in a different conatiner). changing the collection type doesn't make a difference. > > in the log the following lines appear: > > > > [DEBUG ] (app.net4j.socket.PassiveSocketConnector.proxy): Finalizing proxy > > [22566565] > > (appliance:/app/net4j/socket/PassiveSocketConnector). > > [DEBUG ] (app.net4j.socket.PassiveSocketConnector.proxy): Releasing component > > [22566565] > > (appliance:/app/net4j/socket/PassiveSocketConnector). > > [DEBUG ] (app.net4j.socket.PassiveSocketConnector.lifecycle): etherialization > > [DEBUG ] (app.net4j.socket.PassiveSocketConnector.lifecycle): applying shutdown > > [INFO ] (app.net4j.socket.PassiveSocketConnector): disconnected > > [DEBUG ] (app.net4j.ConnectionManager): deregistered connector: [EMAIL PROTECTED], id=1 > > [DEBUG ] (app.net4j.socket.PassiveSocketConnector.lifecycle): applying disposal > > > > the component is declared transient and created when a > > ServerSocketChannel accept()s a SocketChannel. > > the handle to the component (proxy) that is originally resolved > > is thrown away with the stack frame, but before it is registered > > with a ConnectionManager, so that it should not be subject to gc. > > > > please help! > > > > /eike --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]