/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/** Managing security in the Java Sound implementation.
* This class contains all code that uses and is used by
* SecurityManager.doPrivileged().
*
* @author Matthias Pfisterer
*/
final class JSSecurityManager {
/** Prevent instantiation.
*/
private JSSecurityManager() {
}
/** Checks if the VM currently has a SecurityManager installed.
* Note that this may change over time. So the result of this method
* should not be cached.
*
* @return true if a SecurityManger is installed, false otherwise.
*/
private static boolean hasSecurityManager() {
}
}
}
if (hasSecurityManager()) {
try{
try {
} catch (Throwable t) {
return null;
}
}
};
} catch( Exception e ) {
}
} else {
}
return propertyValue;
}
/** Load properties from a file.
This method tries to load properties from the filename give into
the passed properties object.
If the file cannot be found or something else goes wrong,
the method silently fails.
@param properties The properties bundle to store the values of the
properties file.
@param filename The filename of the properties file to load. This
filename is interpreted as relative to the subdirectory "lib" in
the JRE directory.
*/
if(hasSecurityManager()) {
try {
// invoke the privileged action using 1.2 security
return null;
}
};
} catch (Exception e) {
// try without using JDK 1.2 security
}
} else {
// not JDK 1.2 security, assume we already have permission
}
}
try {
throw new Error("Can't find java.home ??");
}
fname = f.getCanonicalPath();
try {
} finally {
}
}
} catch (Throwable t) {
t.printStackTrace();
}
}
}
/** Create a Thread in the current ThreadGroup.
*/
final String threadName,
final boolean doStart) {
if (threadName != null) {
}
if (priority >= 0) {
}
if (doStart) {
}
return thread;
}
// Service.providers(Class) just creates "lazy" iterator instance,
// so it doesn't require do be called from privileged section
// the iterator's hasNext() method looks through classpath for
// the provider class names, so it requires read permissions
}
};
try {
// the iterator's next() method creates instances of the
// providers and it should be called in the current security
// context
// $$mp 2003-08-22
// Always adding at the beginning reverses the
// order of the providers. So we no longer have
// to do this in AudioSystem and MidiSystem.
}
} catch (Throwable t) {
//$$fb 2002-11-07: do not fail on SPI not found
}
}
return p;
}
}