本文整理汇总了Java中org.jitsi.util.OSUtils类的典型用法代码示例。如果您正苦于以下问题:Java OSUtils类的具体用法?Java OSUtils怎么用?Java OSUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OSUtils类属于org.jitsi.util包,在下文中一共展示了OSUtils类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DeviceComboBoxField
import org.jitsi.util.OSUtils; //导入依赖的package包/类
/**
* Constructs <tt>DeviceComboBoxField</tt> instance.
* @param desktopDevices list with the available devices.
* @param devicePanel the container of the field.
*/
public DeviceComboBoxField(Container devicePanel,
List<MediaDevice> desktopDevices)
{
if(!OSUtils.IS_WINDOWS)
{
deviceComboBox = new JComboBox(desktopDevices.toArray());
deviceComboBox.setRenderer(new ComboRenderer());
devicePanel.add(deviceComboBox);
deviceComponent = deviceComboBox;
}
else
{
deviceList = new JList(desktopDevices.toArray());
deviceList.setCellRenderer(new ComboRenderer());
JScrollPane listScroller = new JScrollPane(deviceList);
listScroller.setPreferredSize(new Dimension(200, 38));
deviceList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
deviceList.setLayoutOrientation(JList.VERTICAL);
deviceList.setVisibleRowCount(-1);
deviceList.setSelectedValue(desktopDevices.get(0), true);
devicePanel.add(listScroller, BorderLayout.NORTH);
deviceComponent = deviceList;
}
}
示例2: start
import org.jitsi.util.OSUtils; //导入依赖的package包/类
/**
* Initializes and starts a new <tt>GrowlNotificationService</tt>
* implementation on Mac OS X.
*
* @param bundleContext the <tt>BundleContext</tt> to register the new
* <tt>GrowlNotificationService</tt> implementation into
* @throws Exception if initializing and/or starting the new
* <tt>GrowlNotificationService</tt> implementation fails
*/
public void start(BundleContext bundleContext)
throws Exception
{
// This bundle is available for Mac OS X only.
if (!OSUtils.IS_MAC)
return;
if (logger.isInfoEnabled())
logger.info("Growl Notification... [Starting]");
GrowlNotificationActivator.bundleContext = bundleContext;
handler = new GrowlNotificationServiceImpl();
handler.start(bundleContext);
bundleContext.registerService(
PopupMessageHandler.class.getName(),
handler,
null);
if (logger.isInfoEnabled())
logger.info("Growl Notification... [Started]");
}
示例3: testOpenSSLCTRAES
import org.jitsi.util.OSUtils; //导入依赖的package包/类
@Test
public void testOpenSSLCTRAES()
{
if (!OSUtils.IS_LINUX)
{
return;
}
SRTPCipherCTR cipher = new SRTPCipherCTROpenSSL();
cipher.init(TV_Key);
byte[] data = new byte[TV_Cipher_AES_1.length];
Arrays.fill(data, (byte) 0);
byte[] iv = Arrays.copyOf(TV_IV_1, TV_IV_1.length);
cipher.process(data, 0, data.length, iv);
assertArrayEquals(data, TV_Cipher_AES_1);
Arrays.fill(data, (byte) 0);
iv = Arrays.copyOf(TV_IV_2, TV_IV_2.length);
cipher.process(data, 0, data.length, iv);
assertArrayEquals(data, TV_Cipher_AES_2);
}
示例4: stop
import org.jitsi.util.OSUtils; //导入依赖的package包/类
/**
* Stops this bundle.
*
* @param bundleContext the <tt>BundleContext</tt> to stop this bundle into
* @throws Exception if stopping this bundle fails
*/
public void stop(BundleContext bundleContext)
throws Exception
{
// This bundle is available for Mac OS X only.
if (!OSUtils.IS_MAC)
return;
handler.stop(bundleContext);
if (logger.isInfoEnabled())
logger.info("Growl Notification Service... [Stopped]");
}
示例5: DeviceComboBoxField
import org.jitsi.util.OSUtils; //导入依赖的package包/类
/**
* Constructs <tt>DeviceComboBoxField</tt> instance.
* @param type the type of the configuration panel
* @param devicePanel the container of the field.
*/
public DeviceComboBoxField(final int type, Container devicePanel)
{
model = new DeviceConfigurationComboBoxModel(
mediaService.getDeviceConfiguration(),
type);
if(!OSUtils.IS_WINDOWS
|| type != DeviceConfigurationComboBoxModel.VIDEO)
{
deviceComboBox = new JComboBox();
deviceComboBox.setEditable(false);
deviceComboBox.setModel(model);
devicePanel.add(deviceComboBox);
deviceComponent = deviceComboBox;
}
else
{
deviceList = new JList();
deviceList.setModel(model);
JScrollPane listScroller = new JScrollPane(deviceList);
listScroller.setPreferredSize(new Dimension(200, 38));
deviceList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
deviceList.setLayoutOrientation(JList.VERTICAL);
deviceList.setVisibleRowCount(-1);
deviceList.setSelectedValue(model.getSelectedItem(), true);
devicePanel.add(listScroller);
deviceComponent = deviceList;
}
}
示例6: checkNatives
import org.jitsi.util.OSUtils; //导入依赖的package包/类
private void checkNatives(File pluginDirectory)
{
File nodeFolder = new File(pluginDirectoryPath);
if(!nodeFolder.exists())
{
Log.info("initializePlugin home " + pluginDirectory);
nodeFolder.mkdirs();
}
try
{
String suffix = null;
if(OSUtils.IS_LINUX32)
{
suffix = "linux-32";
}
else if(OSUtils.IS_LINUX64)
{
suffix = "linux-64";
}
else if(OSUtils.IS_WINDOWS32)
{
suffix = "win-32";
}
else if(OSUtils.IS_WINDOWS64)
{
suffix = "win-64";
}
else if(OSUtils.IS_MAC)
{
suffix = "osx-64";
}
if (suffix != null)
{
nodeExePath = pluginDirectory.getAbsolutePath() + File.separator + "native" + File.separator + suffix + File.separator + "node";
File file = new File(nodeExePath);
file.setReadable(true, true);
file.setWritable(true, true);
file.setExecutable(true, true);
Log.info("checkNatives node executable path " + nodeExePath);
} else {
Log.error("checkNatives unknown OS " + pluginDirectory.getAbsolutePath());
}
}
catch (Exception e)
{
Log.error(e.getMessage(), e);
}
}
示例7: registrationStateChanged
import org.jitsi.util.OSUtils; //导入依赖的package包/类
/**
* The method is called by a ProtocolProvider implementation whenever
* a change in the registration state of the corresponding provider had
* occurred. The method is particularly interested in events stating
* that the SIP provider has unregistered so that it would fire
* status change events for all contacts in our buddy list.
*
* @param evt ProviderStatusChangeEvent the event describing the status
* change.
*/
public void registrationStateChanged(RegistrationStateChangeEvent evt)
{
if(evt.getNewState() == RegistrationState.UNREGISTERING ||
evt.getNewState() == RegistrationState.UNREGISTERED ||
evt.getNewState() == RegistrationState.AUTHENTICATION_FAILED ||
evt.getNewState() == RegistrationState.CONNECTION_FAILED)
{
// stop any task associated with the timer
if (keepAliveTimer != null)
{
keepAliveTimer.cancel();
keepAliveTimer = null;
}
}
else if (evt.getNewState().equals(RegistrationState.REGISTERED))
{
String keepAliveMethod =
provider.getAccountID().getAccountPropertyString(
ProtocolProviderFactory.KEEP_ALIVE_METHOD);
if (logger.isTraceEnabled())
logger.trace("Keep alive method " + keepAliveMethod);
// options is default keep-alive, if property is missing
// then options is used
if(keepAliveMethod != null &&
!(keepAliveMethod.equalsIgnoreCase("options")
|| keepAliveMethod.equalsIgnoreCase("crlf")))
return;
int keepAliveInterval =
provider.getAccountID().getAccountPropertyInt(
ProtocolProviderFactory.KEEP_ALIVE_INTERVAL, -1);
if (logger.isTraceEnabled())
logger.trace("Keep alive interval is " + keepAliveInterval);
if (keepAliveInterval > 0
&& !provider.getRegistrarConnection().isRegistrarless())
{
if (keepAliveTimer == null)
keepAliveTimer = new Timer();
TimerTask keepAliveTask;
// CRLF is used by default on Android
if( (OSUtils.IS_ANDROID && keepAliveMethod == null)
|| "crlf".equalsIgnoreCase(keepAliveMethod) )
{
keepAliveTask = new CRLfKeepAliveTask();
}
else
{
// OPTIONS
keepAliveTask = new OptionsKeepAliveTask();
}
if (logger.isDebugEnabled())
logger.debug("Scheduling keep alives: "+keepAliveTask);
keepAliveTimer.schedule(keepAliveTask, 0,
keepAliveInterval * 1000);
}
}
}