migrated to artifacts
[fedora-idea.git] / platform / util / src / com / intellij / openapi / Disposable.java
blob392b30189e832da19fc1699a2bbc37be3bc5041d
1 /*
2 * Copyright 2000-2007 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.openapi;
18 /**
19 * This class marks classes, which require some work done for cleaning up.
20 * As a general policy you shouldn't call the {@link #dispose} method directly,
21 * but register your object to be chained with a parent disposable via {@link com.intellij.openapi.util.Disposer#register(Disposable, Disposable)}.
22 * If you're 100% sure that you should control disposion of your object manually,
23 * do not call the {@link #dispose} method either. Use {@link com.intellij.openapi.util.Disposer#dispose(Disposable)} instead, since
24 * there might be any object registered in chain.
26 public interface Disposable {
27 void dispose();
29 interface Parent extends Disposable {
30 void beforeTreeDispose();