How to "subscribe" to events on an object created by a factory in Java?
I currently have a PipeFilterFactory that creates PipeFilter objects. This is how I am using the factory to create some `PipeFilter`:

		PipeFilterFactory pff = new PipeFilterFactory();
		PipeFilter pipeFilter = pff.createPipeFilter();

The problem I am facing is that I have defined an event on `PipeFilter`:

	public void onOutput(int i);

The original idea would be to have it be ran by overriding `PipeFilter`'s `onOutput`, but having the factory create it raises the problem that now I can't seem to do it (I guess the only way to do it is in `PipeFilter`'s constructor?)

How to solve this?
How to "subscribe" to events on an object created by a factory in Java?
===

I currently have a PipeFilterFactory that creates PipeFilter objects. This is how I am using the factory to create some `PipeFilter`:

		PipeFilterFactory pff = new PipeFilterFactory();
		PipeFilter pipeFilter = pff.createPipeFilter();

The problem I am facing is that I have defined an event on `PipeFilter`:

	public void onOutput(int i);

The original idea would be to have it be ran by overriding `PipeFilter`'s `onOutput`, but having the factory create it raises the problem that now I can't seem to do it (I guess the only way to do it is in `PipeFilter`'s constructor?)

How to solve this?