/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*ident "%Z%%M% %I% %E% SMI"
*/
/**
* The <code>Resource</code> class represents a resource.
*/
{
/**
* The type of the resource.
*/
/**
* The system id of the resource.
*/
/**
* The key of the resource.
*/
/**
* Constructor
* @param conf The configuration to which this pool belongs.
* @param resource The pointer to the native resource which
* this object wraps.
* @throws PoolsException If accessing the proxy fails.
*/
{
}
/**
* Returns a pointer to the native resouce represented by this resource
* object.
*
* @throws PoolsException If the pool cannot be located.
* @return a pointer to the native resource represented by this
* resource object.
*/
{
}
/**
* Transfer the requested quantity of resource from the donor to this
* resource.
*
* @param donor A donating resource.
* @param qty Amount of resource to be donated.
* @throws PoolsException If there is an error whilst donating the
* resource.
*/
{
throw new PoolsException();
}
/**
* Transfer the specified resource components from the donor to this
* resource.
*
* @param donor A donating resource.
* @param components A list of resource components to be donated.
* @throws PoolsException If there is an error whilst donating the
* resource components.
*/
throws PoolsException
{
throw new PoolsException();
}
/**
* Get a list of components which match the supplied selection
* criteria in values. Only components which are controlled by
* this resource are searched.
*
* @param values A list of values to be used to qualify the search.
* @throws PoolsExecption If there is an error executing the query.
* @return a list of components which match the supplied criteria
*/
{
if (PoolInternal.pool_error() ==
return new ArrayList();
else
throw new PoolsException();
}
return (aList);
}
/**
* Returns a descriptive string which describes the resource.
*
* @param deep Whether the information should contain information about
* all contained elements.
* @throws PoolsException If the resource cannot be located.
* @return a descriptive string which describes the resource.
*/
{
getResource(), deep));
}
/**
* Returns a string representation of this resource.
*
* @return a string representation of this resource.
*/
{
}
/**
* Indicates whether some other Resource is "equal to this one.
* @param o the reference object with which to compare.
* @return <code>true</code> if this object is the same as the
* o argument; <code>false</code> otherwise.
* @see #hashCode()
*/
{
if (o == this)
return (true);
if (!(o instanceof Resource))
return (false);
return (false);
return (true);
}
/**
* Returns a hash code value for the object. This method is
* supported for the benefit of hashtables such as those provided by
* <code>java.util.Hashtable</code>.
*
* @return a hash code value for this object.
* @see #equals(java.lang.Object)
* @see java.util.Hashtable
*/
public int hashCode()
{
}
/**
* Return the pointer to this resource as an element.
*
* @return The pointer to the native resource which this object wraps.
* @throws PoolsExecption If there is an error converting the native
* resource pointer to a native elem pointer.
*/
{
long elem;
getResource())) == 0)
throw new PoolsException();
return (elem);
}
/**
* Return the type of the resource
*/
{
return (type);
}
/**
* Return the name of the resource.
*/
{
return (name);
}
/**
* Return the key of the resource.
*/
{
return (key);
}
}